This is an automated email from the ASF dual-hosted git repository.
DomGarguilo 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 ba0291c74e Skip UNKNOWN fate transaction instead of reporting them
(#6627)
ba0291c74e is described below
commit ba0291c74e98c2e0267eaa4b4eff75306b89bebc
Author: Amanda Villarreal <[email protected]>
AuthorDate: Thu Nov 5 14:32:35 2026 -0600
Skip UNKNOWN fate transaction instead of reporting them (#6627)
* Skip UNKNOWN transaction
---
.../org/apache/accumulo/core/fate/AdminUtil.java | 7 ++++-
.../accumulo/monitor/next/SystemInformation.java | 5 +---
.../accumulo/test/fate/FateOpsCommandsITBase.java | 35 +++++++++++-----------
3 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
b/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
index d9a9650e5f..91fe80acf7 100644
--- a/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/fate/AdminUtil.java
@@ -379,6 +379,7 @@ public class AdminUtil<T> {
fateIds.forEach(fateId -> {
ReadOnlyFateTxStore<T> txStore = store.read(fateId);
+
// fate op will not be set if the tx is not seeded with work (it is
NEW)
Fate.FateOperation fateOp =
txStore.getTransactionInfo(Fate.TxInfo.FATE_OP) == null ? null
: ((Fate.FateOperation)
txStore.getTransactionInfo(Fate.TxInfo.FATE_OP));
@@ -406,9 +407,13 @@ public class AdminUtil<T> {
}
TStatus status = txStore.getStatus();
-
long timeCreated = txStore.timeCreated();
+ // the transaction was deleted while its info was being read, skip it
+ if (status == TStatus.UNKNOWN || timeCreated == 0) {
+ return;
+ }
+
if (includeByStatus(status, statusFilter) && includeByFateId(fateId,
fateIdFilter)
&& includeByInstanceType(fateId.getType(), typesFilter)) {
statuses.add(new TransactionStatus(fateId, type, status, fateOp,
hlocks, wlocks, top,
diff --git
a/server/monitor/src/main/java/org/apache/accumulo/monitor/next/SystemInformation.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/next/SystemInformation.java
index 1c8fd237a5..70dfe828cf 100644
---
a/server/monitor/src/main/java/org/apache/accumulo/monitor/next/SystemInformation.java
+++
b/server/monitor/src/main/java/org/apache/accumulo/monitor/next/SystemInformation.java
@@ -1152,10 +1152,7 @@ public class SystemInformation {
transactions.forEach(t -> {
FateOperation op = t.getFateOp();
TStatus status = t.getStatus();
- if (status == TStatus.UNKNOWN || t.getTimeCreated() == 0) {
- // the transaction was deleted while its info was being read, skip it
- return;
- } else if (status == TStatus.SUBMITTED) {
+ if (status == TStatus.SUBMITTED) {
instanceOverview.getTotalFateSubmitted().incrementAndGet();
if (op == FateOperation.TABLE_BULK_IMPORT2) {
instanceOverview.getIngestBulkImportQueued().incrementAndGet();
diff --git
a/test/src/main/java/org/apache/accumulo/test/fate/FateOpsCommandsITBase.java
b/test/src/main/java/org/apache/accumulo/test/fate/FateOpsCommandsITBase.java
index 05fbd7f1b6..ba97473735 100644
---
a/test/src/main/java/org/apache/accumulo/test/fate/FateOpsCommandsITBase.java
+++
b/test/src/main/java/org/apache/accumulo/test/fate/FateOpsCommandsITBase.java
@@ -801,9 +801,9 @@ public abstract class FateOpsCommandsITBase extends
SharedMiniClusterBase
.withArgs(sctx.getZooSession(), null,
null).addMockedMethod(listMethod).createMock();
}
- // 3 FateIds, two that exist and one that does not. We are simulating that
a transaction that
- // doesn't exist is accessed in getTransactionStatus() and ensuring that
this doesn't cause
- // the method to fail or have any unexpected behavior.
+ // Create 3 FateIds, two that exist and one that does not. When iterating
through the list of
+ // transactions in getTransactionStatus(), the 2nd transaction should be
skipped. The other
+ // two transactions should still be returned.
FateId tx1 = store.create();
FateId tx2 = FateId.from(store.type(), UUID.randomUUID());
FateId tx3 = store.create();
@@ -825,31 +825,30 @@ public abstract class FateOpsCommandsITBase extends
SharedMiniClusterBase
verify(mockedStore);
assertNotNull(status);
- // All three should be returned
- assertEquals(3, status.getTransactions().size());
+ // Only the two real transactions should be returned
+ assertEquals(2, status.getTransactions().size());
assertEquals(status.getTransactions().stream().map(AdminUtil.TransactionStatus::getFateId)
- .collect(Collectors.toList()), List.of(tx1, tx2, tx3));
- // The two real FateIds should have NEW status and the fake one should be
UNKNOWN
+ .collect(Collectors.toList()), List.of(tx1, tx3));
+ // The two real FateIds should have NEW status, the fake fateId with
UNKNOWN status is skipped
assertEquals(
status.getTransactions().stream().map(AdminUtil.TransactionStatus::getStatus)
.collect(Collectors.toList()),
- List.of(ReadOnlyFateStore.TStatus.NEW,
ReadOnlyFateStore.TStatus.UNKNOWN,
- ReadOnlyFateStore.TStatus.NEW));
+ List.of(ReadOnlyFateStore.TStatus.NEW, ReadOnlyFateStore.TStatus.NEW));
// None of them should have a name since none of them were seeded with work
assertEquals(status.getTransactions().stream().map(AdminUtil.TransactionStatus::getFateOp)
- .collect(Collectors.toList()), Arrays.asList(null, null, null));
+ .collect(Collectors.toList()), Arrays.asList(null, null));
// None of them should have a Repo since none of them were seeded with work
assertEquals(status.getTransactions().stream().map(AdminUtil.TransactionStatus::getTop)
- .collect(Collectors.toList()), Arrays.asList(null, null, null));
- // The FateId that doesn't exist should have a creation time of 0, the
others should not
- List<Long> timeCreated = status.getTransactions().stream()
-
.map(AdminUtil.TransactionStatus::getTimeCreated).collect(Collectors.toList());
- assertNotEquals(timeCreated.get(0), 0);
- assertEquals(timeCreated.get(1), 0);
- assertNotEquals(timeCreated.get(2), 0);
+ .collect(Collectors.toList()), Arrays.asList(null, null));
+ // The FateId that doesn't exist was not returned but should have a
creation time of 0, the
+ // others should not
+ List<Long> timeCreated =
+
status.getTransactions().stream().map(AdminUtil.TransactionStatus::getTimeCreated).toList();
+ assertNotEquals(0, timeCreated.get(0));
+ assertNotEquals(0, timeCreated.get(1));
// All should have the store.type() type
assertEquals(status.getTransactions().stream().map(AdminUtil.TransactionStatus::getInstanceType)
- .collect(Collectors.toList()), List.of(store.type(), store.type(),
store.type()));
+ .collect(Collectors.toList()), List.of(store.type(), store.type()));
}
private ReadOnlyFateStore.FateIdStatus createFateIdStatus(FateId fateId) {