apache/seatunnel · warning
Post-sync operation failed: table context not found, tableId
Error message
Post-sync operation failed: table context not found, tableId={}, splitId={} What it means
commitSingleOperation looks up the TableScanContext for a pending post-sync operation by its tableId. If the context cannot be found, it logs this warning and returns OpCommitResult.FAILED_RETRYABLE, so the post-sync operation (backup/delete/etc.) is not executed and will be retried later. The operation cannot proceed without the table's scan context (source FS, trash path, etc.).
Source
Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java:700
remainingByCheckpoint.entrySet()) {
pendingOpsByCheckpoint.put(entry.getKey(), entry.getValue());
}
}
log.info(
"Post-sync commit finished for checkpoint {}: attempted={}, success={}, stale_skipped={}, failed={}, remaining_checkpoints={}",
checkpointId,
attempted,
succeeded,
staleSkipped,
failed,
remainingByCheckpoint.size());
}
private OpCommitResult commitSingleOperation(FileSourceOperationState op, long checkpointId) {
Optional<TableScanContext> tableContextOpt = findTableScanContext(op.getTableId());
if (!tableContextOpt.isPresent()) {
log.warn(
"Post-sync operation failed: table context not found, tableId={}, splitId={}",
op.getTableId(),
op.getSplitId());
return OpCommitResult.FAILED_RETRYABLE;
}
try {
if (op.getAction() == FilePostSyncAction.DELETE) {
return commitDeleteOperation(tableContextOpt.get(), op, checkpointId);
}
if (op.getAction() == FilePostSyncAction.BACKUP) {
return commitBackupOperation(tableContextOpt.get(), op, checkpointId);
}
return OpCommitResult.SUCCESS;
} catch (Exception e) {
log.warn(
"Post-sync operation failed and will be retried: action={}, splitId={}, source={}, retryCount={}",
op.getAction(),View on GitHub (pinned to cf67b549a7)
Solutions
- Ensure the job config tables match those referenced by the checkpoint/savepoint being restored from
- Restart with a fresh checkpoint if table definitions changed intentionally
- Verify addTableScanContext registration happens for every table that produces post-sync operations
Defensive patterns
Strategy: retry
Validate before calling
// Before persisting post-sync op state, ensure its tableId is registered
if (!findTableScanContext(op.getTableId()).isPresent()) {
throw new IllegalStateException(
"Cannot queue post-sync op for unregistered tableId=" + op.getTableId());
} Try / catch
Optional<TableScanContext> ctx = findTableScanContext(op.getTableId());
if (!ctx.isPresent()) {
log.warn("Post-sync operation failed: table context not found, tableId={}, splitId={}",
op.getTableId(), op.getSplitId());
return OpCommitResult.FAILED_RETRYABLE;
} Prevention
- Keep table configuration stable across checkpoint/restore
- Never remove a table from config while its post-sync operations are still queued
- Restore checkpoints only with a job config whose table set matches
When it happens
Trigger: A file post-sync operation state references a tableId absent from the enumerator's registered table contexts — e.g. table reconfiguration mid-job, state restored from a mismatched checkpoint, or contexts cleared before commit.
Common situations: Job restart from a checkpoint created under a different table configuration; table removed from config while its queued post-sync ops still exist; restore across config edits.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Skip post-sync staging because table context is not found. s
- Post-sync operation failed and will be retried: action={}, s
- Post-sync delete: rename-to-trash failed, will retry: source
- ACKNOWLEDGE_FAILED
- COMMIT_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/d86e0432e826fb6c.
Report an issue: GitHub.