Github user gyfora commented on a diff in the pull request:
https://github.com/apache/flink/pull/4083#discussion_r123895607
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointV2.java
---
@@ -168,10 +168,27 @@ public static Savepoint
convertToOperatorStateSavepointV2(
expandedToLegacyIds = true;
}
+ if (jobVertex == null) {
+ throw new IllegalStateException(
+ "Could not find task for state with ID
" + taskState.getJobVertexID() + ". " +
+ "When migrating a savepoint from a
version < 1.3 please make sure that the topology was not " +
+ "changed through removal of a stateful
operator or modification of a chain containing a stateful " +
+ "operator.");
+ }
+
List<OperatorID> operatorIDs =
jobVertex.getOperatorIDs();
for (int subtaskIndex = 0; subtaskIndex <
jobVertex.getParallelism(); subtaskIndex++) {
- SubtaskState subtaskState =
taskState.getState(subtaskIndex);
+ SubtaskState subtaskState;
+ try {
+ subtaskState =
taskState.getState(subtaskIndex);
--- End diff --
Sorry for commenting late on this but I have had some major migration
issues in the last few days :D
I think we should explicitly compare parallelism instead of relying on the
error:
if (taskState.getStates().size() != jobVertex.getParallelism()) --> error
Otherwise this will not fail on lower parallelism.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---