This is an automated email from the ASF dual-hosted git repository.
keith-turner 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 8b2de323d7 Fixes blip GC bug (#6675)
8b2de323d7 is described below
commit 8b2de323d7906f73267d4791fb5f3473a5cf2131
Author: Keith Turner <[email protected]>
AuthorDate: Wed Nov 25 11:11:46 2026 -0500
Fixes blip GC bug (#6675)
When the GC saw a blip it was failing because it expected it be a
relative path but now its an absolute path. This was caused by changes
in #6663 and #6611.
When this bug happened the GC was not completing a cycle, however on
monitor GC page it looked like it was completing cycles because it had a
start and finish time. Updated the GC code to only set a finish time if
it does not have an exception.
---
.../java/org/apache/accumulo/gc/GcCandidates.java | 2 +-
.../apache/accumulo/gc/SimpleGarbageCollector.java | 3 +--
.../apache/accumulo/gc/GarbageCollectionTest.java | 22 +++++++++++-----------
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/GcCandidates.java
b/server/gc/src/main/java/org/apache/accumulo/gc/GcCandidates.java
index 0e21b234cb..d57280a468 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/GcCandidates.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/GcCandidates.java
@@ -189,7 +189,7 @@ public class GcCandidates extends
AbstractCollection<GcCandidate> {
}
public int removeBlip(String blip) {
- var lastThree = lastThree(blip, false, 2, 2);
+ var lastThree = lastThree(blip, 2);
String blipPrefix = "/" + lastThree.name + "/";
diff --git
a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 13044b69aa..39cd221e30 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -245,12 +245,11 @@ public class SimpleGarbageCollector extends
AbstractServer implements Iface {
+ new GarbageCollectionAlgorithm().collect(userGC));
incrementStatsForRun(userGC);
logStats();
-
+ status.getCurrent().setFinished(System.currentTimeMillis());
} catch (Exception e) {
TraceUtil.setException(innerSpan, e, false);
log.error("{}", e.getMessage(), e);
} finally {
- status.getCurrent().setFinished(System.currentTimeMillis());
status.setLast(status.getCurrent());
gcCycleMetrics.setLastCollect(status.getCurrent());
status.setCurrent(new GcCycleStats());
diff --git
a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
index ae9da070ab..e47c7acd09 100644
--- a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
+++ b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
@@ -478,8 +478,8 @@ public class GarbageCollectionTest {
gce.addDirReference("6", null, "t-0");
gce.addFileReference("6", null,
"hdfs://foo.com:6000/accumulo/tables/6/b-2/I1234.rf");
- gce.blips.add("/4/b-0");
- gce.blips.add("/5/b-1");
+ gce.blips.add("hdfs://foo.com:6000/accumulo/tables/4/b-0");
+ gce.blips.add("hdfs://foo.com:6000/accumulo/tables/5/b-1");
GarbageCollectionAlgorithm gca = new GarbageCollectionAlgorithm();
@@ -488,7 +488,7 @@ public class GarbageCollectionTest {
assertFileDeleted(gce);
// Remove the first blip
- gce.blips.remove("/4/b-0");
+ gce.blips.remove("hdfs://foo.com:6000/accumulo/tables/4/b-0");
// And we should lose all files in that blip and the blip directory itself
gca.collect(gce);
@@ -496,7 +496,7 @@ public class GarbageCollectionTest {
GcCandidate.forTabletFile("hdfs://foo.com:6000/accumulo/tables/4/b-0/F002.rf",
0L),
GcCandidate.forTabletFile("hdfs://foo.com:6000/accumulo/tables/4/b-0/F001.rf",
1L));
- gce.blips.remove("/5/b-1");
+ gce.blips.remove("hdfs://foo.com:6000/accumulo/tables/5/b-1");
gca.collect(gce);
assertFileDeleted(gce,
GcCandidate.forBulkDir("hdfs://foo.com:6000/accumulo/tables/5/b-1"),
@@ -780,7 +780,7 @@ public class GarbageCollectionTest {
gce = new TestGCE();
- gce.blips.add("/1636/b-0001");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/1636/b-0001");
gce.addCandidate("hdfs://foo:6000/accumulo/tables/1636/b-0001/I0000.rf");
blipCount = gca.collect(gce);
assertFileDeleted(gce);
@@ -788,11 +788,11 @@ public class GarbageCollectionTest {
gce = new TestGCE();
- gce.blips.add("/1029/b-0001");
- gce.blips.add("/1029/b-0002");
- gce.blips.add("/1029/b-0003");
- gce.blips.add("/1000/b-1001");
- gce.blips.add("/1000/b-1002");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/1029/b-0001");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/1029/b-0002");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/1029/b-0003");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/1000/b-1001");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/1000/b-1002");
gce.addCandidate("hdfs://foo:6000/accumulo/tables/1029/b-0002/I0006.rf");
gce.addCandidate("hdfs://foo:6000/accumulo/tables/1000/b-1002/I0007.rf");
var candidate =
gce.addCandidate("hdfs://foo:6000/accumulo/tables/1000/t-0003/I0008.rf");
@@ -1195,7 +1195,7 @@ public class GarbageCollectionTest {
TestGCE gce = new TestGCE();
var protectedCandidate =
gce.addCandidate("hdfs://foo:6000/accumulo/tables/4/b-0/F000.rf");
var siblingCandidate =
gce.addCandidate("hdfs://foo:6000/accumulo/tables/4/b-01/F001.rf");
- gce.blips.add("/4/b-0");
+ gce.blips.add("hdfs://foo:6000/accumulo/tables/4/b-0");
new GarbageCollectionAlgorithm().collect(gce);