DieterDP-ng commented on code in PR #8784:
URL: https://github.com/apache/hbase/pull/8784#discussion_r4350734987


##########
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java:
##########
@@ -758,7 +762,11 @@ private BackupProtos.TableServerTimestamp 
toTableServerTimestampProto(TableName
     for (BackupProtos.ServerTimestamp st : list) {
       ServerName sn =
         
org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil.toServerName(st.getServerName());
-      map.put(sn.getHostname() + ":" + sn.getPort(), st.getTimestamp());
+      // Older versions stored mixed-case keys, so the stored map can hold an 
entry under each
+      // spelling of a host. Both entries map to the same key here. Keeping 
the oldest boundary
+      // includes more WALs in the next incremental backup, so it never skips 
one.
+      map.merge(BackupUtils.toHostKey(sn.getHostname() + ":" + sn.getPort()), 
st.getTimestamp(),
+        Math::min);

Review Comment:
   Perhaps a slightly simpler alternative would be to use `map.put(...)`, since 
it's simpler for whoever will read this in the future, and `merge` isn't 
foolproof anyway. If we add a migration note to do a full backup after the 
upgrade, we close all data loss/re-creation scenarios. WDYT?



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