-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-20978] Implement HeapSavepointRestoreOperation #14648
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 61ff07a (Fri May 28 08:57:22 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
3cdc18c
to
29862de
Compare
29862de
to
6b82089
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes seem good to me, though there currently seem to be test failures. I didn't review the diff of extracting the restore logic to an iterator, instead I reviewed it as a new piece of code and checked that the Rocks backend uses the iterator correctly. Also, I'm trusting the snapshot/restore tests quite a bit because they are decently thorough.
I had some inline questions.
.../main/java/org/apache/flink/contrib/streaming/state/restore/RocksDBFullRestoreOperation.java
Outdated
Show resolved
Hide resolved
flink-tests/src/test/java/org/apache/flink/test/state/SavepointStateBackendSwitchTest.java
Outdated
Show resolved
Hide resolved
flink-tests/src/test/java/org/apache/flink/test/state/SavepointStateBackendSwitchTest.java
Outdated
Show resolved
Hide resolved
6698ad9
to
2fd191a
Compare
d448a45
to
5f2e115
Compare
This commit implements the logic of restoring a heap keyed state backend from a savepoint in a unified binary format. It eagerly deserializes all states and populates the in memory structures.
Introduce a marker SavepointKeyedStateHandle interface for state handles that describe savepoints. Based on the interface we can later decide which strategy to use when restoring from the handle.
5f2e115
to
0d701ad
Compare
@flinkbot run azure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look very good! I had a comment about making the switching test generic for all state backends.
* Tests for the unified savepoint format. They verify you can switch a state backend through a | ||
* savepoint. | ||
*/ | ||
public class SavepointStateBackendSwitchTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a specific test, could we add something like this to StateBackendTestBase
to ensure that all backends that use this test (which should be all of them) can restore from a savepoint? That test is already quite long, so the code should probably be completely in a util but it should still be enforced by the base test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you think about the version of this test from the next PR: 922be55#diff-73a96e160508de0055bc3b19ae1f425e14f8640ae112762cc64498b811d87c9b ?
I reworked it a bit there and made it more declarative. If that's something you like I could move it over to this PR already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that one, yes. But it still has the list of backends hardcoded. In the end it's probably not too big of a deal but I like forcing implementers of new backends to just have to support this if they use the test base. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the changes look very good!
What is the purpose of the change
The PR implements the logic of restoring a heap keyed state backend from a savepoint in a unified binary format.
Brief change log
For more info see the commit messages.
Verifying this change
All current tests for state backends should succeed.
Added a test for verifying the restore from the new savepoint format:
SavepointStateBackendSwitchTest
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation