This is an automated email from the ASF dual-hosted git repository.
vhs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new a261dd941af2 fix: Allow both checkpoint v1 and v2 keys to be resolved
(#17919)
a261dd941af2 is described below
commit a261dd941af2400df49d624d04c1c4d0ba883787
Author: voonhous <[email protected]>
AuthorDate: Mon Jan 19 19:01:07 2026 +0800
fix: Allow both checkpoint v1 and v2 keys to be resolved (#17919)
---
.../InitialCheckpointFromAnotherHoodieTimelineProvider.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/checkpointing/InitialCheckpointFromAnotherHoodieTimelineProvider.java
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/checkpointing/InitialCheckpointFromAnotherHoodieTimelineProvider.java
index cdad39199b91..230e1a1189be 100644
---
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/checkpointing/InitialCheckpointFromAnotherHoodieTimelineProvider.java
+++
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/checkpointing/InitialCheckpointFromAnotherHoodieTimelineProvider.java
@@ -21,6 +21,7 @@ package org.apache.hudi.utilities.checkpointing;
import org.apache.hudi.common.config.TypedProperties;
import org.apache.hudi.common.model.HoodieCommitMetadata;
import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.table.checkpoint.CheckpointUtils;
import org.apache.hudi.exception.HoodieException;
import org.apache.hudi.hadoop.fs.HadoopFSUtils;
@@ -29,8 +30,6 @@ import org.apache.hadoop.conf.Configuration;
import java.io.IOException;
import java.util.Objects;
-import static org.apache.hudi.utilities.streamer.HoodieStreamer.CHECKPOINT_KEY;
-
/**
* This is used to set a checkpoint from latest commit of another (mirror)
hudi dataset.
* Used by integration test.
@@ -58,10 +57,16 @@ public class
InitialCheckpointFromAnotherHoodieTimelineProvider extends InitialC
try {
HoodieCommitMetadata commitMetadata =
anotherDsHoodieMetaClient.getActiveTimeline().readCommitMetadata(instant);
- return commitMetadata.getMetadata(CHECKPOINT_KEY);
+ // Use CheckpointUtils to handle both V1 and V2 checkpoint keys
+ return
CheckpointUtils.getCheckpoint(commitMetadata).getCheckpointKey();
+ } catch (HoodieException e) {
+ // No checkpoint found in this commit
+ return null;
} catch (IOException e) {
return null;
}
- }).filter(Objects::nonNull).findFirst().get();
+ }).filter(Objects::nonNull).findFirst()
+ .orElseThrow(() -> new HoodieException("Unable to find checkpoint in
source table at: "
+ + path + ". This table may not have been created with checkpoint
tracking enabled."));
}
}