You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2018/11/09 15:36:30 UTC
[accumulo] branch 1.9 updated: Only requeue compaction when there
was activity (#759)
This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/1.9 by this push:
new b6409ef Only requeue compaction when there was activity (#759)
b6409ef is described below
commit b6409effe1df98a1a0217bb97a87757477ea1d78
Author: Keith Turner <kt...@apache.org>
AuthorDate: Fri Nov 9 10:36:26 2018 -0500
Only requeue compaction when there was activity (#759)
---
.../apache/accumulo/tserver/tablet/CompactionRunner.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git 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
index 8fab78c..8de7a9e 100644
--- 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
@@ -41,12 +41,18 @@ final class CompactionRunner implements Runnable, Comparable<CompactionRunner> {
return;
}
- tablet.majorCompact(reason, queued);
+ CompactionStats stats = 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);
+ // 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);
+ }
}
}