You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/04/11 17:36:41 UTC
[GitHub] jmark99 closed pull request #420: ACCUMULO-4697 tablet server could
kick off too many idle compactions
jmark99 closed pull request #420: ACCUMULO-4697 tablet server could kick off too many idle compactions
URL: https://github.com/apache/accumulo/pull/420
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 52aaf055dc..99262955fd 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -2140,8 +2140,6 @@ public void run() {
// modification
}
- int numMajorCompactionsInProgress = 0;
-
Iterator<Entry<KeyExtent,Tablet>> iter = copyOnlineTablets.entrySet().iterator();
// bail early now if we're shutting down
@@ -2168,29 +2166,7 @@ public void run() {
}
synchronized (tablet) {
- if (tablet.initiateMajorCompaction(MajorCompactionReason.NORMAL)
- || tablet.isMajorCompactionQueued() || tablet.isMajorCompactionRunning()) {
- numMajorCompactionsInProgress++;
- continue;
- }
- }
- }
-
- int idleCompactionsToStart = Math.max(1,
- getConfiguration().getCount(Property.TSERV_MAJC_MAXCONCURRENT) / 2);
-
- if (numMajorCompactionsInProgress < idleCompactionsToStart) {
- // system is not major compacting, can schedule some
- // idle compactions
- iter = copyOnlineTablets.entrySet().iterator();
-
- while (iter.hasNext() && numMajorCompactionsInProgress < idleCompactionsToStart) {
- Entry<KeyExtent,Tablet> entry = iter.next();
- Tablet tablet = entry.getValue();
-
- if (tablet.initiateMajorCompaction(MajorCompactionReason.IDLE)) {
- numMajorCompactionsInProgress++;
- }
+ tablet.initiateMajorCompaction(MajorCompactionReason.NORMAL);
}
}
} catch (Throwable t) {
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index b3139e77c1..14836be115 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -1531,18 +1531,16 @@ public Path getLocation() {
return location;
}
- public synchronized boolean initiateMajorCompaction(MajorCompactionReason reason) {
+ public synchronized void initiateMajorCompaction(MajorCompactionReason reason) {
if (isClosing() || isClosed() || !needsMajorCompaction(reason) || isMajorCompactionRunning()
|| majorCompactionQueued.contains(reason)) {
- return false;
+ return;
}
majorCompactionQueued.add(reason);
getTabletResources().executeMajorCompaction(getExtent(), new CompactionRunner(this, reason));
-
- return false;
}
/**
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services