[ 
https://issues.apache.org/jira/browse/HBASE-29776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hernan Gelaf-Romer updated HBASE-29776:
---------------------------------------
    Description: 
At the moment, incremental backups will filter out old wals that belong to RS 
which do not have any active WAL files. 

 

The code 

 
{code:java}
// It is possible that a host in .oldlogs is an obsolete region server
// so newestTimestamps.get(host) here can be null.
// Even if these logs belong to a obsolete region server, we still need
// to include they to avoid loss of edits for backup.
Long newTimestamp = newestTimestamps.get(host);
if (newTimestamp == null || currentLogTS > newTimestamp) {
  newestLogs.add(currentLogFile);
}{code}
Is doing the opposite of what the comment (correctly) says. 

  was:
At the moment, incremental backups will filter out old wals that belong to RS 
which do not have any active WAL files. 

 

The code 

 
{code:java}
/*
 * It is possible that there is no old timestamp in backup system table for 
this host. At the
 * time of our last backup operation, this rs did not exist. The reason can be 
one of the two:
 * 1. The rs already left/crashed. Its logs were moved to .oldlogs. 2. The rs 
was added after
 * our last backup.
 */
if (oldTimeStamp == null) {
  if (currentLogTS < Long.parseLong(savedStartCode)) {
  // This log file is really old, its region server was before our last backup.
    continue;
  } else {
    resultLogFiles.add(currentLogFile);
  }
} else if (currentLogTS > oldTimeStamp) {
  resultLogFiles.add(currentLogFile);
} {code}
Is doing the opposite of what the comment (correctly) says. 


> Log filtering in IncrementalBackupManager can lead to data loss
> ---------------------------------------------------------------
>
>                 Key: HBASE-29776
>                 URL: https://issues.apache.org/jira/browse/HBASE-29776
>             Project: HBase
>          Issue Type: Bug
>          Components: backup&amp;restore
>            Reporter: Hernan Gelaf-Romer
>            Priority: Major
>
> At the moment, incremental backups will filter out old wals that belong to RS 
> which do not have any active WAL files. 
>  
> The code 
>  
> {code:java}
> // It is possible that a host in .oldlogs is an obsolete region server
> // so newestTimestamps.get(host) here can be null.
> // Even if these logs belong to a obsolete region server, we still need
> // to include they to avoid loss of edits for backup.
> Long newTimestamp = newestTimestamps.get(host);
> if (newTimestamp == null || currentLogTS > newTimestamp) {
>   newestLogs.add(currentLogFile);
> }{code}
> Is doing the opposite of what the comment (correctly) says. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to