apache/seatunnel · warning

Skip post-sync staging because table context is not found. s

Error message

Skip post-sync staging because table context is not found. splitId={}, tableId={}

What it means

When a source reader reports a split as finished, handleSourceEvent looks up the TableScanContext for that split's tableId to perform post-sync staging. If no matching table context exists, it logs this warning, skips the post-sync operation, and completes the split with no post-sync result. Data sync staging for that split is skipped rather than failing the job.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java:341

    @Override
    public void handleSourceEvent(int subtaskId, SourceEvent sourceEvent) {
        if (!(sourceEvent instanceof FileSplitFinishedEvent)) {
            return;
        }
        FileSplitFinishedEvent fileSplitFinishedEvent = (FileSplitFinishedEvent) sourceEvent;
        String splitId = fileSplitFinishedEvent.getSplitId();
        InFlightSplitContext finishedContext;
        synchronized (lock) {
            finishedContext = inFlightSplitContexts.get(splitId);
        }
        if (finishedContext == null) {
            return;
        }
        Optional<TableScanContext> tableCtxOpt =
                findTableScanContext(finishedContext.split.getTableId());
        if (!tableCtxOpt.isPresent()) {
            log.warn(
                    "Skip post-sync staging because table context is not found. splitId={}, tableId={}",
                    splitId,
                    finishedContext.split.getTableId());
            completeInFlightSplit(splitId, finishedContext, null);
            return;
        }
        TableScanContext tableScanContext = tableCtxOpt.get();
        if (tableScanContext.postSyncAction == FilePostSyncAction.NONE) {
            completeInFlightSplit(splitId, finishedContext, null);
            return;
        }
        FileSourceOperationState opState =
                buildOperationStateFromFinishedSplit(
                        tableScanContext,
                        finishedContext,
                        fileSplitFinishedEvent.getContentFingerprint());
        if (opState == null) {
            return;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check why the tableId is unregistered: verify the job config table definitions match the splits being read
  2. If upgrading/restoring, use a clean savepoint/checkpoint taken with the same table configuration
  3. Review handleSourceEvent/addTableScanContext ordering to ensure contexts are registered before splits can be acknowledged
Defensive patterns

Strategy: validation

Validate before calling

// Before acknowledging a split from the reader, confirm its table is registered
if (tableScanContexts.stream().noneMatch(c -> c.getTableId().equals(split.getTableId()))) {
    throw new IllegalStateException(
            "No TableScanContext registered for tableId=" + split.getTableId());
}

Prevention

When it happens

Trigger: A reader acknowledges a split whose tableId is no longer (or was never) registered in tableScanContexts — e.g. the table was reconfigured, the checkpoint state was restored differently, or an event arrived after table contexts were cleared/changed.

Common situations: Restoring from a checkpoint taken before a config change that altered the table list; racing between table context rebuild and late split-finished events; split IDs carried over from an older job generation.

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


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/385be4f5dfa0f016. Report an issue: GitHub.