You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by gyfora <gi...@git.apache.org> on 2015/09/20 08:43:05 UTC

[GitHub] flink pull request: [FLINK-2713] [streaming] Include custom StateC...

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 <gy...@apache.org>
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2713] [streaming] Include custom StateC...

Posted by senorcarbone <gi...@git.apache.org>.
Github user senorcarbone commented on the pull request:

    https://github.com/apache/flink/pull/1150#issuecomment-141907506
  
    At first I found it a bit odd to include serialized checkpointers on every single statehandle but on a second look maybe that is the only way to generalize operator states. The main problem is that  StreamOperatorState can be defined dynamically during runtime and thus, we need to allow dynamic checkpointers along with the operator states and include them in the state handles. 
    
    An alternative take which is slightly more restrictive is to enforce the user to pre-define all mappings from custom operator state names to checkpointers so we can configure these in the tasks themselves (kept in the execution graph once) instead of including them on each state handle. 
    Apart from this concern the PR is well tested and documented!
    Any other opinions?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2713] [streaming] Include custom StateC...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora commented on the pull request:

    https://github.com/apache/flink/pull/1150#issuecomment-141924945
  
    Another possibility which I am going to try, is to make the state restore lazy, so it is only restored when the user calls state.value() at which point the StateCheckpointer should be set by the user.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2713] [streaming] Include custom StateC...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora commented on the pull request:

    https://github.com/apache/flink/pull/1150#issuecomment-141934393
  
    I opened another PR with the lazy restore, which seems to work much better :):
    
    https://github.com/apache/flink/pull/1154


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2713] [streaming] Include custom StateC...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora commented on the pull request:

    https://github.com/apache/flink/pull/1150#issuecomment-141758138
  
    Travis seems to fail on some unrelated test.
    
    I validated that it fixes my issues with the streaming kv-store checkpoint recovery, where custom StateCheckpointers are used.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: [FLINK-2713] [streaming] Include custom StateC...

Posted by gyfora <gi...@git.apache.org>.
Github user gyfora closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---