[
https://issues.apache.org/jira/browse/HBASE-15634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15247415#comment-15247415
]
Duo Zhang commented on HBASE-15634:
-----------------------------------
The problem is the compaction jitter.
Here we use a compaction period 10 and jitter 0.5, so it is possible that the
returned major compaction time is 15.
In shouldPerformMajorCompaction in DateTieredCompactionPolicy
{code:DateTieredCompactionPolicy.java}
long lowTimestamp = StoreUtils.getLowestTimestamp(filesToCompact);
long now = EnvironmentEdgeManager.currentTime();
if (lowTimestamp <= 0L || lowTimestamp >= (now - mcTime)) {
return false;
}
{code}
The lowTimestamp is the modification time, the value is 1 in
TestDateTieredCompactionPolicy.
Here, now is 16, lowTimestamp is 1, so if the mcTime happens to be 15, then the
lowTimestamp >= (now - mcTime) will pass and return false here.
> TestDateTieredCompactionPolicy#negativeForMajor is flaky
> --------------------------------------------------------
>
> Key: HBASE-15634
> URL: https://issues.apache.org/jira/browse/HBASE-15634
> Project: HBase
> Issue Type: Bug
> Components: test
> Affects Versions: 1.4.0
> Reporter: Ted Yu
> Attachments: 15634.v1.patch
>
>
> https://builds.apache.org/job/PreCommit-HBASE-Build/1365/artifact/patchprocess/patch-unit-hbase-server.txt
> :
> {code}
> negativeForMajor(org.apache.hadoop.hbase.regionserver.TestDateTieredCompactionPolicy)
> Time elapsed: 0.48 sec <<< FAILURE!
> java.lang.AssertionError: expected:<true> but was:<false>
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.failNotEquals(Assert.java:834)
> at org.junit.Assert.assertEquals(Assert.java:118)
> at org.junit.Assert.assertEquals(Assert.java:144)
> at
> org.apache.hadoop.hbase.regionserver.TestDateTieredCompactionPolicy.compactEquals(TestDateTieredCompactionPolicy.java:94)
> at
> org.apache.hadoop.hbase.regionserver.TestDateTieredCompactionPolicy.negativeForMajor(TestDateTieredCompactionPolicy.java:301)
> {code}
> Similar test failure occurred in master JDK 8 build as well
> (https://builds.apache.org/job/HBase-TRUNK_matrix/839/jdk=latest1.8,label=yahoo-not-h2/testReport/org.apache.hadoop.hbase.regionserver/TestDateTieredCompactionPolicy/negativeForMajor/).
> Since TestDateTieredCompactionPolicy is a small test, its failure prevented
> large tests from running.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)