[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15923781#comment-15923781 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann closed the pull request at: https://github.com/apache/flink/pull/3446 > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > Fix For: 1.3.0, 1.1.5, 1.2.1 > > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15923779#comment-15923779 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann closed the pull request at: https://github.com/apache/flink/pull/3451 > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > Fix For: 1.3.0, 1.1.5, 1.2.1 > > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15923778#comment-15923778 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann commented on the issue: https://github.com/apache/flink/pull/3451 Thanks for the review @StephanEwen. See comment on #3446 for the test. Merging this PR. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > Fix For: 1.3.0, 1.1.5, 1.2.1 > > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15923775#comment-15923775 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann closed the pull request at: https://github.com/apache/flink/pull/3448 > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15923769#comment-15923769 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann commented on the issue: https://github.com/apache/flink/pull/3446 Thanks for the review @StephanEwen. Merging this PR. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15905282#comment-15905282 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann commented on the issue: https://github.com/apache/flink/pull/3446 The mocking is indeed a little bit complex in this case. The problem is that you also want to check that a state handle which fails to retrieve its state, is properly discarded. This discard call happens as part of a callback to a ZooKeeper remove call. Since the curator client uses the builder API to construct the ZooKeeper calls, it was necessary to mock all the different build stages. I couldn't find a more succinct way to test this behaviour without starting a ZooKeeper server. If you think it hurts the test's maintainability too much, then I can start a ZooKeeper server for the test. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15905258#comment-15905258 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/3446#discussion_r105419062 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStore.java --- @@ -226,16 +200,43 @@ public CompletedCheckpoint getLatestCheckpoint() throws Exception { return null; } else { - return checkpointStateHandles.getLast().f0.retrieveState(); + while(!checkpointStateHandles.isEmpty()) { + Tuple2checkpointStateHandle = checkpointStateHandles.peekLast(); + + try { + return retrieveCompletedCheckpoint(checkpointStateHandle); + } catch (FlinkException e) { --- End diff -- Technically, I think it was ok, because the `retrieveCompletedCheckpoint` method catches all `Exceptions` and wraps them in a `FlinkException`. But it's better to not rely on this implementation detail. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15905251#comment-15905251 ] ASF GitHub Bot commented on FLINK-5940: --- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/3446#discussion_r105417543 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStore.java --- @@ -226,16 +200,43 @@ public CompletedCheckpoint getLatestCheckpoint() throws Exception { return null; } else { - return checkpointStateHandles.getLast().f0.retrieveState(); + while(!checkpointStateHandles.isEmpty()) { + Tuple2checkpointStateHandle = checkpointStateHandles.peekLast(); + + try { + return retrieveCompletedCheckpoint(checkpointStateHandle); + } catch (FlinkException e) { --- End diff -- Yes, you're right. Will change it. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15901987#comment-15901987 ] ASF GitHub Bot commented on FLINK-5940: --- Github user StephanEwen commented on the issue: https://github.com/apache/flink/pull/3451 Fix looks good, but I have a similar comment about the test as for #3446 > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15901975#comment-15901975 ] ASF GitHub Bot commented on FLINK-5940: --- Github user StephanEwen commented on a diff in the pull request: https://github.com/apache/flink/pull/3446#discussion_r105021165 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/ZooKeeperCompletedCheckpointStore.java --- @@ -226,16 +200,43 @@ public CompletedCheckpoint getLatestCheckpoint() throws Exception { return null; } else { - return checkpointStateHandles.getLast().f0.retrieveState(); + while(!checkpointStateHandles.isEmpty()) { + Tuple2checkpointStateHandle = checkpointStateHandles.peekLast(); + + try { + return retrieveCompletedCheckpoint(checkpointStateHandle); + } catch (FlinkException e) { --- End diff -- I would catch more than `FlinkException` here - after all, we want to fall back to earlier checkpoints in any error case, no? > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15890631#comment-15890631 ] ASF GitHub Bot commented on FLINK-5940: --- GitHub user tillrohrmann opened a pull request: https://github.com/apache/flink/pull/3451 [backport-1.1] [FLINK-5940] [checkpoint] Harden ZooKeeperCompletedCheckpointStore.recover method Backpor of #3446 onto `release-1.1` branch. The ZooKeeperCompletedCheckpointStore only tries to recover the latest completed checkpoint even though it might have read older checkpoint state handles from ZooKeeper. In order to deal with corrupted state handles, this commit changes the behaviour such that the completed checkpoint store adds all read retrievable state handles from ZooKeeper and upon request of the latest checkpoint it will return the latest completed checkpoint which could be retrieved from the state handles. Broken state handles are removed from the completed checkpoint store and ZooKeeper. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tillrohrmann/flink fixCheckpointRecoveryBp1.1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3451.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3451 > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15890590#comment-15890590 ] ASF GitHub Bot commented on FLINK-5940: --- GitHub user tillrohrmann opened a pull request: https://github.com/apache/flink/pull/3448 [backport-1.2] [FLINK-5940] [checkpoint] Harden ZooKeeperCompletedCheckpointStore.recover method Backport of #3446 onto `release-1.2` branch. The ZooKeeperCompletedCheckpointStore only tries to recover the latest completed checkpoint even though it might have read older checkpoint state handles from ZooKeeper. In order to deal with corrupted state handles, this commit changes the behaviour such that the completed checkpoint store adds all read retrievable state handles from ZooKeeper and upon request of the latest checkpoint it will return the latest completed checkpoint which could be retrieved from the state handles. Broken state handles are removed from the completed checkpoint store and ZooKeeper. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tillrohrmann/flink fixCheckpointRecoveryBp1.2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3448.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3448 commit f73f5d0bb1491cefa59d1e58ebc8d6a24a4cbaa1 Author: Till RohrmannDate: 2017-03-01T13:08:35Z [FLINK-5940] [checkpoint] Harden ZooKeeperCompletedCheckpointStore.recover method The ZooKeeperCompletedCheckpointStore only tries to recover the latest completed checkpoint even though it might have read older checkpoint state handles from ZooKeeper. In order to deal with corrupted state handles, this commit changes the behaviour such that the completed checkpoint store adds all read retrievable state handles from ZooKeeper and upon request of the latest checkpoint it will return the latest completed checkpoint which could be retrieved from the state handles. Broken state handles are removed from the completed checkpoint store and ZooKeeper. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (FLINK-5940) ZooKeeperCompletedCheckpointStore cannot handle broken state handles
[ https://issues.apache.org/jira/browse/FLINK-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15890582#comment-15890582 ] ASF GitHub Bot commented on FLINK-5940: --- GitHub user tillrohrmann opened a pull request: https://github.com/apache/flink/pull/3446 [FLINK-5940] [checkpoint] Harden ZooKeeperCompletedCheckpointStore.recover method Before ZooKeeperCompletedCheckpointStore only tried to recover the latest completed checkpoint even though it might have read older checkpoint state handles from ZooKeeper. In order to deal with corrupted state handles, this commit changes the behaviour such that the completed checkpoint store adds all read retrievable state handles from ZooKeeper and upon request of the latest checkpoint it will return the latest completed checkpoint which could be retrieved from the state handles. Broken state handles are removed from the completed checkpoint store and ZooKeeper. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tillrohrmann/flink fixCheckpointRecovery Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3446.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3446 commit e8fe16004562c012f15f2f1efc0ad45157fbb9dd Author: Till RohrmannDate: 2017-03-01T13:08:35Z [FLINK-5940] [checkpoint] Harden ZooKeeperCompletedCheckpointStore.recover method The ZooKeeperCompletedCheckpointStore only tries to recover the latest completed checkpoint even though it might have read older checkpoint state handles from ZooKeeper. In order to deal with corrupted state handles, this commit changes the behaviour such that the completed checkpoint store adds all read retrievable state handles from ZooKeeper and upon request of the latest checkpoint it will return the latest completed checkpoint which could be retrieved from the state handles. Broken state handles are removed from the completed checkpoint store and ZooKeeper. > ZooKeeperCompletedCheckpointStore cannot handle broken state handles > > > Key: FLINK-5940 > URL: https://issues.apache.org/jira/browse/FLINK-5940 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing >Affects Versions: 1.2.0, 1.1.4, 1.3.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann > > The {{ZooKeeperCompletedCheckpointStore}} reads a set of > {{RetrievableStateHandles}} from ZooKeeper upon recovery. It then tries to > retrieve the {{CompletedCheckpoint}} from the latest state handle. If the > retrieve operation fails, then the whole recovery of completed checkpoints > fails even though the store might have read older state handles from > ZooKeeper. > I propose to harden the behaviour by removing broken state handles and > returning the first successfully retrieved {{CompletedCheckpoint}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)