Jieshan Bean created HBASE-7324:
-----------------------------------

             Summary: Archive the logs instead of deletion after distributed 
splitting
                 Key: HBASE-7324
                 URL: https://issues.apache.org/jira/browse/HBASE-7324
             Project: HBase
          Issue Type: Bug
          Components: wal
    Affects Versions: 0.94.3, 0.96.0
            Reporter: Jieshan Bean


We should always move the logs to .oldlogs instead of deleting them directly. 
The negative effect of this bug may cause data-loss if we enabled replication.
The below code is extracted from SplitLogManager#splitLogDistributed:
{code}
for(Path logDir: logDirs){
      status.setStatus("Cleaning up log directory...");
      try {
        if (fs.exists(logDir) && !fs.delete(logDir, false)) {
          LOG.warn("Unable to delete log src dir. Ignoring. " + logDir);
        }
      } catch (IOException ioe) {
        FileStatus[] files = fs.listStatus(logDir);
        if (files != null && files.length > 0) {
          LOG.warn("returning success without actually splitting and " + 
              "deleting all the log files in path " + logDir);
        } else {
          LOG.warn("Unable to delete log src dir. Ignoring. " + logDir, ioe);
        }
      }
      tot_mgr_log_split_batch_success.incrementAndGet();
    }
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to