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


##########
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:
   Indeed, using `min` could lead to a WAL being included again (resurrecting 
data), whereas using `max` instead could lead to a WAL being left out (missing 
data). That would only be the case for the first incremental backup, and can be 
circumvented by creating a full backup first.
   
   However, it was HBASE-29776 that introduced the case where there can be 
different casings of the same host in this map, so that issue doesn't occur if 
one is migrating from the previously released HBASE version.
   
   



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