apache/seatunnel · warning
Could not calculate standalone splits
Error message
Could not calculate standalone splits: {}, fallback to SampleSplitter What it means
SplitVectorSplitStrategy executed splitVector successfully at the transport level but the response's 'ok' flag is false (isCommandSucceed fails). It logs this warning with the response's errmsg and falls back to SampleBucketSplitter — the server declined to compute split keys.
Solutions
- Check the errmsg value in the log for the exact server-side rejection reason.
- Correct keyPattern/chunkSizeMB parameters to match the collection's shard key and valid size range.
- Test the command manually in mongosh to reproduce the errmsg.
- Fall back intentionally by configuring SampleSplitter as the strategy.
Defensive patterns
Strategy: validation
Validate before calling
// dry-run splitVector and inspect ok/errmsg
const r = db.runCommand({splitVector: 'mydb.mycoll', keyPattern: {userId: 1}, maxChunkSizeBytes: 64*1024*1024});
if (r.ok !== 1) print('splitVector rejected: ' + r.errmsg); Prevention
- Check the logged errmsg for the precise server rejection.
- Validate keyPattern/chunkSizeMB against the shard key before running the job.
- Keep an explicit sampling fallback configured for splitVector-hostile environments.
When it happens
Trigger: split() receives a BsonDocument result from splitVector where ok != 1 and errmsg is set, e.g. the server rejects the keyPattern or chunk size even though no exception was thrown.
Common situations: Command responded with errmsg like 'keyPattern must match shard key' or size validation errors on mongos; older server versions returning ok:0 instead of throwing.
Understand the failure class
Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.
Related errors
- Collection does not appear to be sharded, fallback to…
- Execute splitVector command failed
- Cannot extract clusterTime from change stream event…
- Change stream cursor has expired, trying to recreate cursor
- Could not register for streaming with metadata in messages…
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/cbc1ea06c60709fc.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mongodb/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mongodb/source/splitters/SplitVectorSplitStrategy.java:79
BsonDocument splitResult;
try {
splitResult = splitVector(mongoClient, collectionId, keyPattern, chunkSizeMB);
} catch (MongoCommandException e) {
if (e.getErrorCode() == UNAUTHORIZED_ERROR) {
log.warn(
"Unauthorized to execute splitVector command: {}, fallback to SampleSplitter",
e.getErrorMessage());
} else {
log.warn(
"Execute splitVector command failed: {}, fallback to SampleSplitter",
e.getErrorMessage());
}
return SampleBucketSplitStrategy.INSTANCE.split(splitContext);
}
if (!isCommandSucceed(splitResult)) {
log.warn(
"Could not calculate standalone splits: {}, fallback to SampleSplitter",
splitResult.getString("errmsg"));
return SampleBucketSplitStrategy.INSTANCE.split(splitContext);
}
BsonArray splitKeys = splitResult.getArray("splitKeys");
if (CollectionUtils.isEmpty(splitKeys)) {
// documents size is less than chunk size, treat the entire collection as single chunk.
return SingleSplitStrategy.INSTANCE.split(splitContext);
}
SeaTunnelRowType rowType = shardKeysToRowType(Collections.singleton(ID_FIELD));
List<SnapshotSplit> snapshotSplits = new ArrayList<>(splitKeys.size() + 1);
BsonValue lowerValue = new BsonMinKey();
;
for (int i = 0; i < splitKeys.size(); i++) {
BsonValue splitKeyValue = splitKeys.get(i).asDocument().get(ID_FIELD);View on GitHub (pinned to cf67b549a7)