hgromer commented on code in PR #8694:
URL: https://github.com/apache/hbase/pull/8694#discussion_r4094542926
##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalBackupManager.java:
##########
@@ -72,12 +72,46 @@ public Map<String, Long> getIncrBackupLogFileMap() throws
IOException {
LOG.info("Execute roll log procedure for incremental backup ...");
BackupUtils.logRoll(conn, backupInfo.getBackupRootDir(), conf);
- newTimestamps = readRegionServerLastLogRollResult();
+ Map<String, Long> newTimestamps = new HashMap<>();
+ Map<String, Long> latestLogRollByHost =
readRegionServerLastLogRollResult();
+ for (Map.Entry<String, Long> entry : latestLogRollByHost.entrySet()) {
+ String host = entry.getKey();
+ long latestLogRoll = entry.getValue();
+ Long earliestTimestampToIncludeInBackup =
previousTimestampMins.get(host);
+
+ boolean isInactive = earliestTimestampToIncludeInBackup != null
+ && earliestTimestampToIncludeInBackup >= latestLogRoll;
+
+ if (isInactive) {
+ LOG.debug(
+ "Skipping inactive host {} from newTimestamps (boundary={} >=
latestLogRoll={})", host,
+ earliestTimestampToIncludeInBackup, latestLogRoll);
+ } else {
+ newTimestamps.put(host, latestLogRoll);
+ }
+ }
logList = getLogFilesForNewBackup(previousTimestampMins, newTimestamps,
conf);
logList = excludeProcV2WALs(logList);
backupInfo.setIncrBackupFileList(logList);
+ // Update boundaries based on WALs that will be backed up
+ for (String logFile : logList) {
+ Path logPath = new Path(logFile);
+ String logHost = BackupUtils.parseHostFromOldLog(logPath);
+ if (logHost == null) {
+ logHost = BackupUtils.parseHostNameFromLogFile(logPath.getParent());
+ }
+ if (logHost != null) {
Review Comment:
I don't think so, because the second if is checking to see if
`BackupUtils.parseHostNameFromLogFile` returns null or not
--
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]