lkokhreidze commented on issue #10892:
URL: https://github.com/apache/iceberg/issues/10892#issuecomment-2275481345

   Thanks for the reply @pvary ! Just for my understanding - is there technical 
reason why we can't call 
[ManageSnapshots#setCurrentSnapshot](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/ManageSnapshots.java#L53)
 API when recovery happens?
   
   Flow could be something like this:
   1. When job state is restored, get the snapshot ID from the Flink state.
   2. If current snapshot id of the table and one restored from the flink state 
is the same, do nothing, all seems good.
   3. If snapshot ID from the Flink's state is different, do the following:
      - Get history of the snapshots and make sure that we still have that 
snapshot id in history, if not fail the recovery with explicit error msg.
      - If snapshot ID is available in the history, use 
[ManageSnapshots#setCurrentSnapshot](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/ManageSnapshots.java#L53)
 API to set the current snapshot of the table.
   


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to