This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
     new 0fe740067a Fixed UpgradeUtilIT, broken after #5807 (#5826)
0fe740067a is described below

commit 0fe740067ad966de1aecc9c3e90d575d272fff98
Author: Dave Marion <dlmar...@apache.org>
AuthorDate: Mon Aug 25 11:14:26 2025 -0400

    Fixed UpgradeUtilIT, broken after #5807 (#5826)
    
    Created the paths in ZooKeeper that UpgradeUtil is expecting
    for prior versions of Accumulo so that it can perform compaction
    service configuration validation.
    
    Closes #5823
---
 .../apache/accumulo/test/upgrade/UpgradeUtilIT.java  | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git 
a/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeUtilIT.java 
b/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeUtilIT.java
index 38d9b3c8ee..2b3481a754 100644
--- a/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeUtilIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/upgrade/UpgradeUtilIT.java
@@ -18,15 +18,18 @@
  */
 package org.apache.accumulo.test.upgrade;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.IOException;
+import java.util.SortedSet;
 import java.util.UUID;
 
 import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.data.TableId;
 import org.apache.accumulo.core.fate.zookeeper.ZooReader;
 import org.apache.accumulo.core.fate.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.core.fate.zookeeper.ZooUtil;
@@ -48,9 +51,24 @@ import org.junit.jupiter.api.Test;
 
 public class UpgradeUtilIT extends AccumuloClusterHarness {
 
+  private static final String ZTABLE_NAME = "/name";
+
   @BeforeEach
   public void beforeTest() throws Exception {
-    var zrw = getCluster().getServerContext().getZooSession().asReaderWriter();
+    ServerContext ctx = getCluster().getServerContext();
+    var zrw = ctx.getZooSession().asReaderWriter();
+
+    // Mini starts as a 4.0 instance, need to make it look like a prior
+    // version for UpgradeUtil.
+
+    // Create table name nodes in ZooKeeper that existed prior to 4.0
+    SortedSet<String> tables = 
getCluster().getServerContext().tableOperations().list();
+    for (String table : tables) {
+      TableId tid = TableId.of(ctx.tableOperations().tableIdMap().get(table));
+      zrw.putPersistentData(Constants.ZTABLES + "/" + tid + ZTABLE_NAME, 
table.getBytes(UTF_8),
+          NodeExistsPolicy.SKIP);
+    }
+
     zrw.delete(Constants.ZPREPARE_FOR_UPGRADE);
     zrw.delete(Constants.ZUPGRADE_PROGRESS);
 

Reply via email to