bvaradar commented on code in PR #9226:
URL: https://github.com/apache/hudi/pull/9226#discussion_r1275360526
##########
hudi-common/src/main/java/org/apache/hudi/common/util/ClusteringUtils.java:
##########
@@ -258,26 +258,29 @@ public static Option<HoodieInstant>
getOldestInstantToRetainForClustering(
? cleanInstant
:
HoodieTimeline.getCleanRequestedInstant(cleanInstant.getTimestamp()))
.getEarliestInstantToRetain();
- String retainLowerBound;
+ String instantTimeLowerBound;
Review Comment:
```if the timeline of a hoodie table is replace1 commit2 clean3, the
earliestInstantToRetain of clean3 is commit2, then replace1 is considered ready
for archival no matter when it is completed. But if replace1 is completed after
clean3, then the replaced files in replace1 are not cleaned, so it should not
be archived. This pr fix such case.```
- In the above case, we should have earliestInstantToRetain to be replace1
if it is not completed. we should guarantee that earliestInstantToRetain
should <= earliest pending instant in terms of timeline.
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -580,6 +580,7 @@ protected void autoArchiveOnCommit(HoodieTable table) {
return;
}
+ table.getMetaClient().reloadActiveTimeline();
Review Comment:
Why do we need this reload ? Can we avoid it ?
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieDefaultTimeline.java:
##########
@@ -436,6 +436,13 @@ public List<HoodieInstant> getInstants() {
return new ArrayList<>(instants);
}
+ /**
+ * Get the instant by instant timestamp and state
+ */
+ public Option<HoodieInstant> getInstant(String timestamp, State state) {
Review Comment:
Rename to getInstantByTimestampAndState
--
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]