This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/elasticity by this push:
new 7af0decd1c speed up merge operation for lots of tablets (#4574)
7af0decd1c is described below
commit 7af0decd1c9082911afb04e0e785cc0daa8f0135
Author: Keith Turner <[email protected]>
AuthorDate: Fri May 24 13:47:52 2024 -0400
speed up merge operation for lots of tablets (#4574)
Adjusted the sleep time for one of the Fate steps to consider how long a
scan took. For SplitMillionIT this resulted in ReserveTablets.isReady()
sleeping for around 30s instead of 60s.
---
.../apache/accumulo/manager/tableOps/merge/ReserveTablets.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
index b3d246572a..c6a8402da0 100644
---
a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
+++
b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java
@@ -32,6 +32,7 @@ import org.apache.accumulo.core.metadata.schema.Ample;
import org.apache.accumulo.core.metadata.schema.Ample.ConditionalResult.Status;
import org.apache.accumulo.core.metadata.schema.TabletOperationId;
import org.apache.accumulo.core.metadata.schema.TabletOperationType;
+import org.apache.accumulo.core.util.time.NanoTime;
import org.apache.accumulo.manager.Manager;
import org.apache.accumulo.manager.tableOps.ManagerRepo;
import org.slf4j.Logger;
@@ -70,6 +71,7 @@ public class ReserveTablets extends ManagerRepo {
int locations = 0;
int wals = 0;
+ var startTime = NanoTime.now();
try (
var tablets =
env.getContext().getAmple().readTablets().forTable(data.tableId)
.overlapping(range.prevEndRow(), range.endRow()).fetch(PREV_ROW,
LOCATION, LOGS, OPID)
@@ -95,6 +97,7 @@ public class ReserveTablets extends ManagerRepo {
count++;
}
}
+ var maxSleepTime = Math.min(60000, startTime.elapsed().toMillis());
log.debug(
"{} reserve tablets op:{} count:{} other opids:{} opids set:{}
locations:{} accepted:{} wals:{}",
@@ -111,14 +114,15 @@ public class ReserveTablets extends ManagerRepo {
opsAccepted.get(), fateId);
}
+ long sleepTime = Math.min(Math.max(1000, count), maxSleepTime);
if (locations > 0 || otherOps > 0 || wals > 0) {
// need to wait on these tablets
- return Math.min(Math.max(1000, count), 60000);
+ return sleepTime;
}
if (opsSet != opsAccepted.get()) {
// not all operation ids were set
- return Math.min(Math.max(1000, count), 60000);
+ return sleepTime;
}
// operations ids were set on all tablets and no tablets have locations,
so ready