accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] 01/01: Merge branch '1.9'
Date Fri, 09 Nov 2018 15:40:37 GMT
This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 5cdf125296005728ed767a61681170ec7fa2a536
Merge: 95214d4 b6409ef
Author: Keith Turner <kturner@apache.org>
AuthorDate: Fri Nov 9 10:37:30 2018 -0500

    Merge branch '1.9'

 .../apache/accumulo/tserver/tablet/CompactionRunner.java | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
index d51c4eb,8de7a9e..5b127d5
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactionRunner.java
@@@ -34,13 -34,25 +34,19 @@@ final class CompactionRunner implement
  
    @Override
    public void run() {
 -    if (tablet.getTabletServer().isMajorCompactionDisabled()) {
 -      // this will make compaction tasks that were queued when shutdown was
 -      // initiated exit
 -      tablet.removeMajorCompactionQueuedReason(reason);
 -      return;
 -    }
  
-     tablet.majorCompact(reason, queued);
- 
-     // if there is more work to be done, queue another major compaction
-     synchronized (tablet) {
-       if (reason == MajorCompactionReason.NORMAL && tablet.needsMajorCompaction(reason))
-         tablet.initiateMajorCompaction(reason);
+     CompactionStats stats = tablet.majorCompact(reason, queued);
+ 
+     // Some compaction strategies may always return true for shouldCompact() because they
need to
+     // make blocking calls to gather information. Without the following check these strategies
would
+     // endlessly requeue. So only check if a subsequent compaction is needed if the previous
+     // compaction actually did something.
+     if (stats != null && stats.getEntriesRead() > 0) {
+       // if there is more work to be done, queue another major compaction
+       synchronized (tablet) {
+         if (reason == MajorCompactionReason.NORMAL && tablet.needsMajorCompaction(reason))
+           tablet.initiateMajorCompaction(reason);
+       }
      }
    }
  


Mime
View raw message