-
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-36001][state] Store operator name and UID in state metadata #25267
Conversation
In order to help reviewers the general concept is the following. |
} | ||
|
||
@Test | ||
public void testChangeUidHashOnly(@TempDir Path tmp) throws Exception { |
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.
Some extra coverage where only the hash changed.
String savepointPath, Tuple2<Collection<Integer>, String>... assertions) | ||
throws Exception { | ||
String savepointPath, ValidationParameters... validationParameters) throws Exception { | ||
// validate metadata |
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 intention here with the extra assertions is to make sure that UID
and hash
are consistent with each other.
@@ -213,7 +213,7 @@ private List<Integer> readInputSplit( | |||
throws IOException { | |||
KeyedStateInputFormat<Integer, VoidNamespace, Integer> format = | |||
new KeyedStateInputFormat<>( | |||
new OperatorState(OperatorIDGenerator.fromUid("uid"), 1, 4), | |||
new OperatorState(null, null, OperatorIDGenerator.fromUid("uid"), 1, 4), |
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.
Such cases I've considered to add a constructor where UID
and name
fields are just hardcoded null
values (then we wouldn't need so many code changes in tests) but then I've ended up to miss production code parts where the mentioned fields are essential which caused partially working solution. I think having a rock state state story is must have from user's perspective so I've implemented this a more defensive way (compiler blows up not having enough constructor parameters) in order to change all the required execution paths.
cc @gyfora |
44b3619
to
5c99a89
Compare
Thanks @gaborgsomogyi , overall looks good. Please add 1-2 comments to the critical parts that you also explain in the PR. |
5c99a89
to
204fd5e
Compare
Just rebased and added some explanation to the code. |
@Zakelly any comments/thought? |
Thanks for the heads up, looking into this... |
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 for the PR, I left some comments, PTAL.
...ies/flink-state-processing-api/src/main/java/org/apache/flink/state/api/SavepointWriter.java
Show resolved
Hide resolved
...runtime/src/main/java/org/apache/flink/runtime/checkpoint/metadata/MetadataV5Serializer.java
Outdated
Show resolved
Hide resolved
7772b98
to
b3ee07b
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.
Thanks for the update! Overall LGTM.
...runtime/src/main/java/org/apache/flink/runtime/checkpoint/metadata/MetadataV5Serializer.java
Show resolved
Hide resolved
b3ee07b
to
142e5f1
Compare
@gaborgsomogyi this PR broke the master build by missing the license header for |
Oh gosh, fixing it now. |
Just filed: #25329 |
What is the purpose of the change
Normally users can define an operator in a Flink application like this where
UID
andname
can be assigned to it:At the moment checkpoint metadata file is not containing operator
UID
andname
which makes hard for users to find out what is the human readable intention for a specific operator. Please see FLIP-474 further details.In this PR I've added the 2 mentioned fields into metadata file.
Brief change log
Added operator
UID
andname
to metadata file.Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation