Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Release Notes

## [5.7.1] - TBD
## [5.7.1] - 2025-12-15
- Fix batch write consistency [issue #257](https://github.com/datastax/cassandra-data-migrator/issues/257).
- Upgraded Java driver to `4.19.2` to consume fixes upstream for addressing the issue described at [CASSJAVA-116](https://issues.apache.org/jira/browse/CASSJAVA-116) issue.

## [5.7.0] - 2025-11-19
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/datastax/cdm/job/CopyJobSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.datastax.cdm.job;

import java.math.BigInteger;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.CompletionStage;
Expand Down Expand Up @@ -48,13 +49,16 @@ public class CopyJobSession extends AbstractJobSession<PartitionRange> {
public Logger logger = LoggerFactory.getLogger(this.getClass().getName());
private TargetUpsertStatement targetUpsertStatement;
private TargetSelectByPKStatement targetSelectByPKStatement;
private BatchStatement batch = BatchStatement.newInstance(BatchType.UNLOGGED);

protected CopyJobSession(CqlSession originSession, CqlSession targetSession, PropertyHelper propHelper) {
super(originSession, targetSession, propHelper);
pkFactory = this.originSession.getPKFactory();
isCounterTable = this.originSession.getCqlTable().isCounterTable();
fetchSize = this.originSession.getCqlTable().getFetchSizeInRows();
batchSize = this.originSession.getCqlTable().getBatchSize();
batch.setConsistencyLevel(this.targetSession.getCqlTable().getWriteConsistencyLevel())
.setTimeout(Duration.ofSeconds(10));

logger.info("CQL -- origin select: {}", this.originSession.getOriginSelectByPartitionRangeStatement().getCQL());
logger.info("CQL -- target select: {}", this.targetSession.getTargetSelectByPKStatement().getCQL());
Expand All @@ -68,7 +72,6 @@ protected void processPartitionRange(PartitionRange range) {
if (null != trackRunFeature)
trackRunFeature.updateCdmRun(runId, min, TrackRun.RUN_STATUS.STARTED, "");

BatchStatement batch = BatchStatement.newInstance(BatchType.UNLOGGED);
JobCounter jobCounter = range.getJobCounter();

try {
Expand Down