GitHub user gyfora opened a pull request:
https://github.com/apache/flink/pull/1150
[FLINK-2713] [streaming] Include custom StateCheckpointers in the snapshots
Currently failure recovery fails when using custom StateCheckpointers
because they are not correctly set before trying to restore the operator
initial state. This PR solves this issue by including custom StateCheckpointers
in the snapshot.
The current order of events and the problem:
1. Create StreamTask
2. Call restoreInitialState(snapshot) -> default java-serialization
StateCheckpointer is used
3. Open UDF and run computation. -> This is the point when custom
StateCheckpointers are set
4. Take snapshots....
We can see while the custom StateCheckpointers are available and work for
taking snapshots they are not set set yet when call restore which obviously
leads to error.
This PR now includes the custom StateCheckpointer in the snapshot so we can
set it in step 2. before calling restore. An optimization is that we include
only the serialized version as a byte array in the buffer so we don't need to
serialize it over and over again.
The PR also extends the StreamCheckpointingITCase and the
PartitionedStateCheckpointingITCase to include a case for custom
StateCheckpointers for both local and partitioned OperatorStates.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gyfora/flink checkpointer
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1150.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 #1150
----
commit ca8c04899554c0d438154b5eefc3e8e6b5543888
Author: Gyula Fora <[email protected]>
Date: 2015-09-19T19:35:07Z
[FLINK-2713] [streaming] Include custom StateCheckpointers in the snapshots
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---