MartijnVisser commented on code in PR #209:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/209#discussion_r4687171540


##########
flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/core/datastream/source/enumerator/JdbcSourceEnumerator.java:
##########
@@ -150,12 +182,29 @@ private Optional<JdbcSourceSplit> getNextSplit() {
         return Optional.of(next);
     }
 
+    /**
+     * Re-stamps a split with the snapshot id of the current run. Splits 
restored from a checkpoint
+     * carry the id exported by the failed attempt, but that exported snapshot 
died with its
+     * exporting connection, so the reader would fail with "snapshot does not 
exist" (and keep
+     * failing after every restart). Splits produced fresh by this run already 
carry the current id
+     * and are returned unchanged; non-snapshot splits are unaffected.
+     */
+    private JdbcSourceSplit refreshSnapshotId(JdbcSourceSplit split) {

Review Comment:
   Splits restored from reader state never reach this and keep the old snapshot 
id, so after a global failover or savepoint restore the job fails on `invalid 
snapshot identifier`. I reproduced that on Postgres 16.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to