HBASE-15634 TestDateTieredCompactionPolicy#negativeForMajor is flaky (Duo Zhang and Ted Yu)

This commit is contained in:
tedyu 2016-04-26 09:24:38 -07:00
parent 9f222d59e1
commit 2562043e23
2 changed files with 8 additions and 1 deletions

View File

@ -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;
}

View File

@ -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);
}
/**