Savonitar commented on code in PR #28709:
URL: https://github.com/apache/flink/pull/28709#discussion_r3646775020
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/metadata/MetadataV2V3SerializerBase.java:
##########
@@ -760,13 +793,43 @@ static void serializeStreamStateHandle(StreamStateHandle
stateHandle, DataOutput
for (int keyGroup : keyGroupsStateHandle.getKeyGroupRange()) {
dos.writeLong(keyGroupsStateHandle.getOffsetForKeyGroup(keyGroup));
}
-
serializeStreamStateHandle(keyGroupsStateHandle.getDelegateStateHandle(), dos);
+
serializeStreamStateHandle(keyGroupsStateHandle.getDelegateStateHandle(), dos,
context);
} else {
throw new IOException(
"Unknown implementation of StreamStateHandle: " +
stateHandle.getClass());
}
}
+ /**
+ * Decides whether a {@link RelativeFileStateHandle} can be written with
the relative encoding,
+ * or has to be written with its absolute path like a plain {@link
FileStateHandle}.
+ *
+ * <p>The relative encoding stores only the file name. Whoever reads the
metadata later rebuilds
+ * the full path as {@code <directory containing the metadata>/<file
name>} (see {@link
+ * #resolveRelativeHandle}). This only works for files that actually live
in the directory the
+ * metadata is written to. Files elsewhere (for example a claimed
savepoint's SSTs that a later
+ * incremental checkpoint still references) would be looked up at a path
where they do not
+ * exist, so their handles must keep the absolute path. If the directory
being written to is
+ * unknown ({@code null}), the legacy behavior applies and the relative
encoding is kept.
+ */
+ private static boolean canKeepRelativeEncoding(
+ RelativeFileStateHandle handle, @Nullable SerializationContext
context) {
Review Comment:
Agreed, addressed in
https://github.com/apache/flink/pull/28709/changes/c626f460154.
> Could you elaborate what those legacy paths are?
I meant the pre-fix behavior (unconditional-relative encoding).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]