HBASE-19578 MasterProcWALs cleaning is incorrect
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
00b0288c96
commit
35728acd21
|
@ -160,7 +160,7 @@ public class ProcedureWALFile implements Comparable<ProcedureWALFile> {
|
|||
boolean archived = false;
|
||||
if (walArchiveDir != null) {
|
||||
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)) {
|
||||
LOG.warn("Failed archive of " + logFile + ", deleting");
|
||||
} else {
|
||||
|
|
|
@ -147,7 +147,7 @@ public final class MasterProcedureUtil {
|
|||
* Pattern used to validate a Procedure WAL file name see
|
||||
* {@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-<wal-id>.log where wal-id is 20 digits.
|
||||
|
|
|
@ -134,7 +134,7 @@ public class TestLogsCleaner {
|
|||
|
||||
// Case 2: 5 Procedure WALs that are old which would be deleted
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class TestLogsCleaner {
|
|||
|
||||
// Case 5: 5 Procedure WALs that are new, will stay
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue