Skip to content

Commit 026a1a3

Browse files
committed
Add require status condition to pop()
1 parent 7e88c81 commit 026a1a3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

core/src/main/java/org/apache/accumulo/core/fate/accumulo/AccumuloStore.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ public void pop() {
268268
verifyReserved(true);
269269

270270
Optional<Integer> top = findTop();
271-
top.ifPresent(t -> newMutator(fateId).deleteRepo(t).mutate());
271+
top.ifPresent(t -> newMutator(fateId)
272+
.requireStatus(TStatus.FAILED_IN_PROGRESS, TStatus.SUCCESSFUL, TStatus.FAILED)
273+
.deleteRepo(t).mutate());
272274
}
273275

274276
@Override

test/src/main/java/org/apache/accumulo/test/fate/accumulo/FateStoreIT.java

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ protected void testReadWrite(FateStore<TestEnv> store, ServerContext sctx)
100100
assertEquals(TestRepo.class, ops.get(1).getClass());
101101

102102
// test pop, TestOperation should be left
103+
txStore.setStatus(TStatus.FAILED); // needed to satisfy the condition on pop
103104
txStore.pop();
104105
ops = txStore.getStack();
105106
assertEquals(1, ops.size());

0 commit comments

Comments
 (0)