{"record":{"id":"e20f81382423b168","repo":"apache/seatunnel","slug":"not-supported-create-new-offset-by-timestamp","errorCode":null,"errorMessage":"not supported create new Offset by timestamp.","messagePattern":"not supported create new Offset by timestamp\\.","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/offset/LsnOffsetFactory.java","lineNumber":75,"sourceCode":"        } catch (Exception e) {\n            throw new RuntimeException(\"Read the binlog offset error\", e);\n        }\n    }\n\n    @Override\n    public Offset specific(Map<String, String> offset) {\n        return LsnOffset.valueOf(offset);\n    }\n\n    @Override\n    public Offset specific(String filename, Long position) {\n        throw new UnsupportedOperationException(\n                \"not supported create new Offset by filename and position.\");\n    }\n\n    @Override\n    public Offset timestamp(long timestamp) {\n        throw new UnsupportedOperationException(\"not supported create new Offset by timestamp.\");\n    }\n}\n","sourceCodeStart":57,"sourceCodeEnd":78,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-db2/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/db2/source/offset/LsnOffsetFactory.java#L57-L78","documentation":"LsnOffsetFactory implements the Offset factory interface for DB2 CDC, but only supports creating offsets from filename+position (LSN). The timestamp(long) method is explicitly unsupported because DB2 LSN offsets cannot be derived from an arbitrary timestamp in this implementation.","triggerScenarios":"Calling LsnOffsetFactory.timestamp(long), typically when the CDC framework attempts to start or restart a snapshot/streaming split from a timestamp-based offset instead of a stored LSN offset.","commonSituations":"Restoring a job from a state/checkpoint that lacks a valid LSN offset and falls back to timestamp-based startup; configuring a start mode that requests offsets by timestamp; framework code that generically calls Offset.timestamp for offset negotiation.","solutions":["Use an offset created via the LSN (filename+position) path instead of a timestamp","Set the CDC start mode to initial or earliest rather than timestamp-based","Provide a valid saved offset (LSN) from a previous run's checkpoint/state backend"],"exampleFix":"// before\nOffset offset = new LsnOffsetFactory().timestamp(1700000000L);\n// after\nOffset offset = new LsnOffsetFactory().create(filename, lsnPosition);","handlingStrategy":"try-catch","validationCode":"if (factory instanceof LsnOffsetFactory) { throw new IllegalArgumentException(\"timestamp-based offset not supported for DB2 CDC; use LSN offset\"); }","typeGuard":"boolean supportsTimestamp = !(offsetFactory instanceof LsnOffsetFactory);","tryCatchPattern":"try { offset = factory.timestamp(ts); } catch (UnsupportedOperationException e) { offset = factory.create(lsnFile, lsnPos); }","preventionTips":["Always restore from SeaTunnel checkpoints/state, not ad-hoc timestamps","Use initial/earliest offset modes for DB2 CDC sources"],"tags":["cdc","db2","offset","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}