danny0405 commented on code in PR #13653:
URL: https://github.com/apache/hudi/pull/13653#discussion_r2246931054
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/rollback/RestorePlanActionExecutor.java:
##########
@@ -75,10 +80,19 @@ public Option<HoodieRestorePlan> execute() {
.filter(instant -> GREATER_THAN.test(instant.requestedTime(),
savepointToRestoreTimestamp))
.collect(Collectors.toList());
- // Get all the commits on the timeline after the provided commit time
+ // Get all the commits on the timeline after the provided commit's
completion time unless it is the SOLO_COMMIT_TIMESTAMP which indicates there
are no commits for the table
+ String completionTime =
savepointToRestoreTimestamp.equals(SOLO_COMMIT_TIMESTAMP) ?
savepointToRestoreTimestamp :
completionTimeQueryView.getCompletionTime(savepointToRestoreTimestamp)
+ .orElseThrow(() -> new HoodieException("Unable to find completion
time for instant: " + savepointToRestoreTimestamp));
List<HoodieInstant> commitInstantsToRollback =
table.getActiveTimeline().getWriteTimeline()
- .getReverseOrderedInstants()
- .filter(instant -> GREATER_THAN.test(instant.requestedTime(),
savepointToRestoreTimestamp))
+ .getReverseOrderedInstantsByCompletionTime()
+ .filter(instant -> {
+ // For compaction on tables with version less than 8, if the
compaction started before the target of the restore, it must not be removed
since the log files will reference this commit
+ if (instant.getAction().equals(HoodieTimeline.COMMIT_ACTION)
&&
!metaClient.getTableConfig().getTableVersion().greaterThanOrEquals(HoodieTableVersion.EIGHT)
Review Comment:
!greaterThanOrEquals -> lessThan
--
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]