[ 
https://issues.apache.org/jira/browse/FLINK-2713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14877445#comment-14877445
 ] 

ASF GitHub Bot commented on FLINK-2713:
---------------------------------------

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

----


> Custom StateCheckpointers should be included in the snapshots
> -------------------------------------------------------------
>
>                 Key: FLINK-2713
>                 URL: https://issues.apache.org/jira/browse/FLINK-2713
>             Project: Flink
>          Issue Type: Bug
>          Components: Streaming
>            Reporter: Gyula Fora
>            Assignee: Gyula Fora
>
> Currently the restoreInitialState call fails when the user uses a custom 
> StateCheckpointer to create the snapshot, because the state is restored 
> before the StateCheckpointer is set for the StreamOperatorState. (because the 
> restoreInitialState() call precedes the open() call)
> To avoid this issue, the custom StateCheckpointer instance should be stored 
> within the snapshot and should be set in the StreamOperatorState before 
> calling restoreState(..).
> To reduce the overhead induced by this we can do 2 optimizations:
>  - We only include custom StateCheckpointers (the default java serializer one 
> is always available)
>  - We only serialize the checkpointer once and store the byte array in the 
> snapshot



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to