hgromer commented on code in PR #7717:
URL: https://github.com/apache/hbase/pull/7717#discussion_r2800186283


##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/master/BackupLogCleaner.java:
##########
@@ -103,11 +102,12 @@ private BackupBoundaries 
serverToPreservationBoundaryTs(BackupSystemTable sysTab
         
backups.stream().map(BackupInfo::getBackupId).sorted().collect(Collectors.joining(",
 ")));
     }
 
-    // This map tracks, for every backup root, the most recent created backup 
(= highest timestamp)
+    // This map tracks, for every backup root, the most recent (= highest 
timestamp) completed
+    // backup, or if there is no such one, the currently running backup (if 
any)
     Map<String, BackupInfo> newestBackupPerRootDir = new HashMap<>();
     for (BackupInfo backup : backups) {
       BackupInfo existingEntry = 
newestBackupPerRootDir.get(backup.getBackupRootDir());
-      if (existingEntry == null || existingEntry.getStartTs() < 
backup.getStartTs()) {
+      if (existingEntry == null || existingEntry.getState() == 
BackupState.RUNNING) {

Review Comment:
   Are backups returned sorted latest --> oldest? If so this change makes 
sense, otherwise we may not be grabbing the latest completed backup with the 
first entry



-- 
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]

Reply via email to