HBASE-15634 TestDateTieredCompactionPolicy#negativeForMajor is flaky (Duo Zhang and Ted Yu)
This commit is contained in:
parent
9f222d59e1
commit
2562043e23
|
@ -112,6 +112,9 @@ public class DateTieredCompactionPolicy extends SortedCompactionPolicy {
|
|||
throws IOException {
|
||||
long mcTime = getNextMajorCompactTime(filesToCompact);
|
||||
if (filesToCompact == null || mcTime == 0) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("filesToCompact: " + filesToCompact + " mcTime: " + mcTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -119,6 +122,10 @@ public class DateTieredCompactionPolicy extends SortedCompactionPolicy {
|
|||
long lowTimestamp = StoreUtils.getLowestTimestamp(filesToCompact);
|
||||
long now = EnvironmentEdgeManager.currentTime();
|
||||
if (lowTimestamp <= 0L || lowTimestamp >= (now - mcTime)) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("lowTimestamp: " + lowTimestamp + " lowTimestamp: " + lowTimestamp + " now: " +
|
||||
now + " mcTime: " + mcTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class TestDateTieredCompactionPolicy extends AbstractTestDateTieredCompac
|
|||
this.conf.setFloat(CompactionConfiguration.HBASE_HSTORE_COMPACTION_RATIO_KEY, 1.2F);
|
||||
|
||||
conf.setInt(HStore.BLOCKING_STOREFILES_KEY, 20);
|
||||
conf.setLong(HConstants.MAJOR_COMPACTION_PERIOD, 10);
|
||||
conf.setLong(HConstants.MAJOR_COMPACTION_PERIOD, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue