[
https://issues.apache.org/jira/browse/FLINK-5019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15636392#comment-15636392
]
ASF GitHub Bot commented on FLINK-5019:
---------------------------------------
Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/2746#discussion_r86549195
--- Diff:
flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
---
@@ -339,9 +339,12 @@ protected void run() {
SubtaskState subtaskState =
taskState.getState(tdd.getIndexInSubtaskGroup());
assertNotNull(subtaskState);
- errMsg = "Initial operator state
mismatch.";
- assertEquals(errMsg,
subtaskState.getLegacyOperatorState(),
-
tdd.getTaskStateHandles().getLegacyOperatorState());
+
+ if (subtaskState.hasState()) {
--- End diff --
I think this check can actually be replaced by
`subtaskState.getLegacyOperatorState()` and if you do that there is no place in
the code that calls `SubtaskState.hasState()`, making it obsolete.
Please correct me if I'm wrong. 😅
> Proper isRestored result for tasks that did not write state
> -----------------------------------------------------------
>
> Key: FLINK-5019
> URL: https://issues.apache.org/jira/browse/FLINK-5019
> Project: Flink
> Issue Type: Bug
> Reporter: Stefan Richter
> Assignee: Stefan Richter
>
> When a subtask is restored from a checkpoint that does not contain any state
> (e.g. because the subtask did not write state in the previous run), the
> result of {{StateInitializationContext::isRestored}} will incorrectly return
> false.
> We should ensure that empty state is somehow reflected in a checkpoint and
> return true on restore, independent from the presence of state.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)