{"record":{"id":"385be4f5dfa0f016","repo":"apache/seatunnel","slug":"skip-post-sync-staging-because-table-context-is-no","errorCode":null,"errorMessage":"Skip post-sync staging because table context is not found. splitId={}, tableId={}","messagePattern":"Skip post-sync staging because table context is not found\\. splitId=(.+?), tableId=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java","lineNumber":341,"sourceCode":"\n    @Override\n    public void handleSourceEvent(int subtaskId, SourceEvent sourceEvent) {\n        if (!(sourceEvent instanceof FileSplitFinishedEvent)) {\n            return;\n        }\n        FileSplitFinishedEvent fileSplitFinishedEvent = (FileSplitFinishedEvent) sourceEvent;\n        String splitId = fileSplitFinishedEvent.getSplitId();\n        InFlightSplitContext finishedContext;\n        synchronized (lock) {\n            finishedContext = inFlightSplitContexts.get(splitId);\n        }\n        if (finishedContext == null) {\n            return;\n        }\n        Optional<TableScanContext> tableCtxOpt =\n                findTableScanContext(finishedContext.split.getTableId());\n        if (!tableCtxOpt.isPresent()) {\n            log.warn(\n                    \"Skip post-sync staging because table context is not found. splitId={}, tableId={}\",\n                    splitId,\n                    finishedContext.split.getTableId());\n            completeInFlightSplit(splitId, finishedContext, null);\n            return;\n        }\n        TableScanContext tableScanContext = tableCtxOpt.get();\n        if (tableScanContext.postSyncAction == FilePostSyncAction.NONE) {\n            completeInFlightSplit(splitId, finishedContext, null);\n            return;\n        }\n        FileSourceOperationState opState =\n                buildOperationStateFromFinishedSplit(\n                        tableScanContext,\n                        finishedContext,\n                        fileSplitFinishedEvent.getContentFingerprint());\n        if (opState == null) {\n            return;","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java#L323-L359","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check why the tableId is unregistered: verify the job config table definitions match the splits being read","If upgrading/restoring, use a clean savepoint/checkpoint taken with the same table configuration","Review handleSourceEvent/addTableScanContext ordering to ensure contexts are registered before splits can be acknowledged"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before acknowledging a split from the reader, confirm its table is registered\nif (tableScanContexts.stream().noneMatch(c -> c.getTableId().equals(split.getTableId()))) {\n    throw new IllegalStateException(\n            \"No TableScanContext registered for tableId=\" + split.getTableId());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never change table definitions between a checkpoint and its restore","Ensure table scan contexts are registered before splits can be dispatched/acknowledged","On restore, verify checkpoint table IDs match the current job config"],"tags":["file-connector","split-enumerator","table-context","post-sync"],"backgroundTag":"record-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}