GitHub user gyfora opened a pull request:

    https://github.com/apache/flink/pull/1154

    [FLINK-2713] [streaming] Set state restore to lazy to avoid 
StateCheckpointer issues and reduce checkpoint overhead

    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 making state restore lazy (only 
happens if the user wants to access the value of the state)
    
    The current order of events and the problem:
     1. Create StreamTask
     2. Call restoreInitialState(snapshot) -> default java-serialization 
StateCheckpointer is used
     2. Open UDF and run computation. -> This is the point when custom 
StateCheckpointers are set
     2. 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.
    
    The change is:
     1. Create StreamTask
     2. Call restoreInitialState(snapshot) -> state is not restored yet, but a 
flag is set
     3. Open UDF and run computation. -> This is the point when custom 
StateCheckpointers are set
     4. The state is restored when the user accesses the value
     5. Take snapshots... (just return the last checkpoint if not restored yet)
    
    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 lazyrestore

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1154.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 #1154
    
----
commit d1e590cbfcf9296a90aa846fd6dc49d9c7a0f077
Author: Gyula Fora <[email protected]>
Date:   2015-09-21T10:07:47Z

    [FLINK-2713] [streaming] Set state restore to lazy to avoid 
StateCheckpointer issues and reduce checkpoint overhead

----


---
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.
---

Reply via email to