This is an automated email from the ASF dual-hosted git repository.
krathbun pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 8c25167e20 Fixes broken TotalQueuedIT 2.1+ (#5735)
8c25167e20 is described below
commit 8c25167e2019fe013205c4876be0337820cd1a90
Author: Kevin Rathbun <[email protected]>
AuthorDate: Fri Jul 11 10:49:12 2025 -0400
Fixes broken TotalQueuedIT 2.1+ (#5735)
* Fixes broken TotalQueuedIT 2.1+
Problem was two-fold:
1) ed40b628514750c95e3e40abcd8330493f4d99a3 updated the set of fixed
properties to be more accurate. This test was changing a property
that was newly declared as fixed, so config change wasn't being picked
up since related servers weren't restarted. Now restart related servers
(the TServers) after config change.
2) The config set before starting the MAC called `cfg.useMiniDFS()`
which simply returned the value of `useMiniDFS`, and didn't set
anything. This caused things to hang after restarting the TServers.
Changed to `cfg.useMiniDFS(true)` and renamed `useMiniDFS()` ->
`getUseMiniDFS()`
---
.../accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java | 8 ++++----
.../accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java | 2 +-
.../main/java/org/apache/accumulo/test/TotalQueuedIT.java | 15 ++++++++++++---
3 files changed, 17 insertions(+), 8 deletions(-)
diff --git
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
index 0f3b8bae07..c360bf269d 100644
---
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
+++
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
@@ -182,7 +182,7 @@ public class MiniAccumuloClusterImpl implements
AccumuloCluster {
mkdirs(config.getAccumuloDir());
}
- if (config.useMiniDFS()) {
+ if (config.getUseMiniDFS()) {
File nn = new File(config.getAccumuloDir(), "nn");
mkdirs(nn);
File dn = new File(config.getAccumuloDir(), "dn");
@@ -480,7 +480,7 @@ public class MiniAccumuloClusterImpl implements
AccumuloCluster {
justification = "insecure socket used for reservation")
@Override
public synchronized void start() throws IOException, InterruptedException {
- if (config.useMiniDFS() && miniDFS.get() == null) {
+ if (config.getUseMiniDFS() && miniDFS.get() == null) {
throw new IllegalStateException("Cannot restart mini when using
miniDFS");
}
@@ -883,7 +883,7 @@ public class MiniAccumuloClusterImpl implements
AccumuloCluster {
}
var miniDFSActual = miniDFS.get();
- if (config.useMiniDFS() && miniDFSActual != null) {
+ if (config.getUseMiniDFS() && miniDFSActual != null) {
miniDFSActual.shutdown();
}
for (Process p : cleanup) {
@@ -979,7 +979,7 @@ public class MiniAccumuloClusterImpl implements
AccumuloCluster {
@Override
public Path getTemporaryPath() {
String p;
- if (config.useMiniDFS()) {
+ if (config.getUseMiniDFS()) {
p = "/tmp/";
} else {
File tmp = new File(config.getDir(), "tmp");
diff --git
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
index 323bc00f88..3cd23e301a 100644
---
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
+++
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
@@ -608,7 +608,7 @@ public class MiniAccumuloConfigImpl {
return this;
}
- public boolean useMiniDFS() {
+ public boolean getUseMiniDFS() {
return useMiniDFS;
}
diff --git a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
index 91c788481c..9b99c5f24e 100644
--- a/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TotalQueuedIT.java
@@ -35,6 +35,7 @@ import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.rpc.clients.ThriftClientTypes;
import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
import org.apache.accumulo.core.util.HostAndPort;
+import org.apache.accumulo.minicluster.ServerType;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
import org.apache.accumulo.server.ServerContext;
import org.apache.accumulo.test.functional.ConfigurableMacBase;
@@ -51,7 +52,10 @@ public class TotalQueuedIT extends ConfigurableMacBase {
@Override
public void configure(MiniAccumuloConfigImpl cfg, Configuration
hadoopCoreSite) {
cfg.setNumTservers(1);
- cfg.useMiniDFS();
+ // use mini DFS so walogs sync and flush will work
+ cfg.useMiniDFS(true);
+ // property is a fixed property (requires restart to be picked up), so set
here in initial cfg
+ cfg.setProperty(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX.getKey(), "" +
SMALL_QUEUE_SIZE);
}
private int SMALL_QUEUE_SIZE = 100000;
@@ -61,8 +65,6 @@ public class TotalQueuedIT extends ConfigurableMacBase {
@Test
public void test() throws Exception {
try (AccumuloClient c =
Accumulo.newClient().from(getClientProperties()).build()) {
-
c.instanceOperations().setProperty(Property.TSERV_TOTAL_MUTATION_QUEUE_MAX.getKey(),
- "" + SMALL_QUEUE_SIZE);
String tableName = getUniqueNames(1)[0];
c.tableOperations().create(tableName);
c.tableOperations().setProperty(tableName,
Property.TABLE_MAJC_RATIO.getKey(), "9999");
@@ -101,6 +103,13 @@ public class TotalQueuedIT extends ConfigurableMacBase {
"" + LARGE_QUEUE_SIZE);
c.tableOperations().flush(tableName, null, null, true);
sleepUninterruptibly(1, TimeUnit.SECONDS);
+
+ // property changed is a fixed property (requires restart to be picked
up), restart TServers
+ c.tableOperations().offline(tableName, true);
+
getCluster().getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
+
getCluster().getClusterControl().startAllServers(ServerType.TABLET_SERVER);
+ c.tableOperations().online(tableName, true);
+
try (BatchWriter bw = c.createBatchWriter(tableName, cfg)) {
now = System.currentTimeMillis();
bytesSent = 0;