This is an automated email from the ASF dual-hosted git repository.
kturner 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 667c01b323 Makes external compaction IT more tolerant of spurious
compactions (#5810)
667c01b323 is described below
commit 667c01b323ec147c7c9721026cdb64c53e2cbe92
Author: Keith Turner <[email protected]>
AuthorDate: Wed Aug 20 17:33:48 2025 -0400
Makes external compaction IT more tolerant of spurious compactions (#5810)
Its possible that spurious compactions can happen on the metadata table.
These could cause some of the external compactions ITs to fail.
Modified the test to look for specific items in a set instead of looking
at the size of the set to fix this.
---
.../test/compaction/ExternalCompaction_1_IT.java | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
index 8f559f2353..0444e28ca0 100644
---
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
+++
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_1_IT.java
@@ -122,12 +122,16 @@ import org.apache.hadoop.io.Text;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
public class ExternalCompaction_1_IT extends SharedMiniClusterBase {
private static ServiceLock testLock;
+ private static final Logger log =
LoggerFactory.getLogger(ExternalCompaction_1_IT.class);
+
public static class ExternalCompaction1Config implements
MiniClusterConfigurationCallback {
@Override
public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration
coreSite) {
@@ -425,15 +429,19 @@ public class ExternalCompaction_1_IT extends
SharedMiniClusterBase {
FateId fateId, List<ExternalCompactionId> cids) {
var ctx = getCluster().getServerContext();
+ log.info("cids:{}", cids);
+ var compactionWithFate = cids.get(0);
+ var compactionWithoutFate = cids.get(1);
+
// Wait until the compaction id w/o a fate transaction is removed, should
still see the one
// with a fate transaction
Wait.waitFor(() -> {
Set<ExternalCompactionId> currentIds =
ctx.getAmple().readTablets().forTable(tableId).build()
.stream().map(TabletMetadata::getExternalCompactions)
.flatMap(ecm -> ecm.keySet().stream()).collect(Collectors.toSet());
- System.out.println("currentIds1:" + currentIds);
- assertTrue(currentIds.size() == 1 || currentIds.size() == 2);
- return currentIds.equals(Set.of(cids.get(0)));
+ log.info("currentIds1:{}", currentIds);
+ assertTrue(currentIds.contains(compactionWithFate));
+ return currentIds.contains(compactionWithFate) &&
!currentIds.contains(compactionWithoutFate);
});
// Delete the fate transaction, should allow the dead compaction detector
to clean up the
@@ -447,9 +455,8 @@ public class ExternalCompaction_1_IT extends
SharedMiniClusterBase {
Set<ExternalCompactionId> currentIds =
ctx.getAmple().readTablets().forTable(tableId).build()
.stream().map(TabletMetadata::getExternalCompactions)
.flatMap(ecm -> ecm.keySet().stream()).collect(Collectors.toSet());
- System.out.println("currentIds2:" + currentIds);
- assertTrue(currentIds.size() <= 1);
- return currentIds.isEmpty();
+ log.info("currentIds2:{}", currentIds);
+ return !currentIds.contains(compactionWithFate);
});
}