HBASE-19578 MasterProcWALs cleaning is incorrect

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Peter Somogyi 2017-12-21 13:15:05 +01:00 committed by tedyu
parent 00b0288c96
commit 35728acd21
3 changed files with 4 additions and 4 deletions

View File

@ -160,7 +160,7 @@ public class ProcedureWALFile implements Comparable<ProcedureWALFile> {
boolean archived = false; boolean archived = false;
if (walArchiveDir != null) { if (walArchiveDir != null) {
Path archivedFile = new Path(walArchiveDir, logFile.getName()); Path archivedFile = new Path(walArchiveDir, logFile.getName());
LOG.info("ARCHIVED (TODO: FILES ARE NOT PURGED FROM ARCHIVE!) " + logFile + " to " + archivedFile); LOG.info("Archiving " + logFile + " to " + archivedFile);
if (!fs.rename(logFile, archivedFile)) { if (!fs.rename(logFile, archivedFile)) {
LOG.warn("Failed archive of " + logFile + ", deleting"); LOG.warn("Failed archive of " + logFile + ", deleting");
} else { } else {

View File

@ -147,7 +147,7 @@ public final class MasterProcedureUtil {
* Pattern used to validate a Procedure WAL file name see * Pattern used to validate a Procedure WAL file name see
* {@link #validateProcedureWALFilename(String)} for description. * {@link #validateProcedureWALFilename(String)} for description.
*/ */
private static final Pattern pattern = Pattern.compile(".*pv-\\d{20}.log"); private static final Pattern pattern = Pattern.compile(".*pv2-\\d{20}.log");
/** /**
* A Procedure WAL file name is of the format: pv-&lt;wal-id&gt;.log where wal-id is 20 digits. * A Procedure WAL file name is of the format: pv-&lt;wal-id&gt;.log where wal-id is 20 digits.

View File

@ -134,7 +134,7 @@ public class TestLogsCleaner {
// Case 2: 5 Procedure WALs that are old which would be deleted // Case 2: 5 Procedure WALs that are old which would be deleted
for (int i = 1; i < 6; i++) { for (int i = 1; i < 6; i++) {
Path fileName = new Path(oldProcedureWALDir, String.format("pv-%020d.log", i)); Path fileName = new Path(oldProcedureWALDir, String.format("pv2-%020d.log", i));
fs.createNewFile(fileName); fs.createNewFile(fileName);
} }
@ -155,7 +155,7 @@ public class TestLogsCleaner {
// Case 5: 5 Procedure WALs that are new, will stay // Case 5: 5 Procedure WALs that are new, will stay
for (int i = 6; i < 11; i++) { for (int i = 6; i < 11; i++) {
Path fileName = new Path(oldProcedureWALDir, String.format("pv-%020d.log", i)); Path fileName = new Path(oldProcedureWALDir, String.format("pv2-%020d.log", i));
fs.createNewFile(fileName); fs.createNewFile(fileName);
} }