[ 
https://issues.apache.org/jira/browse/HBASE-12030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14146157#comment-14146157
 ] 

Anoop Sam John commented on HBASE-12030:
----------------------------------------

Thanks a lot Jingcheng for the test.
2 comments on the test
{code}
+    for (int i = 0; i < compactionThreshold; i++) {
+      Put p = new Put(Bytes.toBytes(i));
+      p.setDurability(Durability.SKIP_WAL);
+      p.add(COLUMN_FAMILY, Bytes.toBytes("colX"), dummyData);
+      loader.put(p);
+      loader.flushcache();
+    }
+    assertEquals("Before compaction: store files", compactionThreshold,
+        countStoreFiles());
+    assertEquals("Before compaction: mob file count", compactionThreshold,
+        countMobFiles());
+    Delete delete = new Delete(deleteRow);
+    delete.deleteFamily(COLUMN_FAMILY);
+    region.delete(delete);
+    loader.flushcache();
+    assertEquals("Before compaction: store files", compactionThreshold + 1,
+        countStoreFiles());
+    region.compactStores(true);
+    assertEquals("Before compaction: store files", 1, countStoreFiles());
{code}
We flush compactionThreshold with puts. This itself can trigger an auto 
compaction (before the delete going in)  So the assert 
assertEquals(compactionThreshold + 1, countStoreFiles()) can get failed some 
times. Better we add compactionThreshold -1 times put and one time delete and 
then go with compaction.

assertEquals("Before compaction: store files", 1, countStoreFiles()); -> The 
msg to be After compaction

> Wrong compaction report and assert when MOB compaction switches to minor
> ------------------------------------------------------------------------
>
>                 Key: HBASE-12030
>                 URL: https://issues.apache.org/jira/browse/HBASE-12030
>             Project: HBase
>          Issue Type: Bug
>          Components: Compaction, regionserver
>    Affects Versions: hbase-11339
>            Reporter: Matteo Bertozzi
>            Priority: Critical
>             Fix For: hbase-11339
>
>         Attachments: HBASE-12030-V2.diff, HBASE-12030.patch
>
>
> when zookeeper is down during a major compaction or a sweep tool run in 
> progress, we switch to a minor.
> {code}
> try {
>   zk = MobZookeeper.newInstance(this.conf, compactionName);
> } catch (KeeperException e) {
>   LOG.error("Cannot connect to the zookeeper, ready to perform the minor 
> compaction instead", e);
>   // change the major compaction into a minor one
>   compaction.getRequest().setIsMajor(false);
>   return super.compact(compaction);
> }
> {code}
> but the "request start" (HRegion.reportCompactionRequestStart) is "major" and 
> increments the major-compactions counter
> while the "request end" (HRegion.reportCompactionRequestEnd) is "minor" and 
> decrements the minor-compactions counter
> triggering the assert newValue >= 0, since we are decrementing the wrong 
> counter



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to