Skip to content

Replace AbstractFateStore.verifyReserved() with new method FateMutator.requireReserved() - #6521

Merged
dlmarion merged 10 commits into
apache:mainfrom
Amemeda:4908-require-reserved
Sep 30, 2026
Merged

dlmarion merged 10 commits into
apache:mainfrom
Amemeda:4908-require-reserved

Conversation

@Amemeda

@Amemeda Amemeda commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Add new method to FateMutator.java that requires a FateId to be reserved for certain transactions. This method will replace AbstractFateStore.verifyReservedAndNotDeleted() implementation in UserFateStore.java.

  • Added FateMutator.requireReserved() and its implementation in FateMutatorImpl.java. requireReserved() requires a transaction to be reserved with a specific FateStore.FateReservation.
  • Removed usages of verifyReservedandNotDeleted() from UserFateStore.java methods. To replace its implementation, new method requireReserved() called through new helper method newReservedMutator in push(), pop(), setStatus(), setTransactionInfo(), delete(), and forceDelete(). For methods top(), getStack(), getTransactionInfo(), and timeCreated(), verifyReservedandNotDeleted() simply was removed since it is a no-op.

Closes #4908

@Amemeda
Amemeda marked this pull request as draft August 31, 2026 16:09
@Amemeda

Amemeda commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

(OUTDATED)
Since verifyReservedAndNotDeleted() was removed from UserFateStore.java, new requireReserved() was implemented in its place on the FateMutator side. However, in 4 UserFateStore.java methods (top, getStack, getTransactionInfo, timeCreated) there is no corresponding fateMutator method being called where requireReserved() should be added. Unsure how to replace implementation for these 4 methods.

@Amemeda Amemeda changed the title Replace AFS.verifyReserved with a condition Replace AbstractFateStote.verifyReserved() with new method FateMutator.requireReserved() Sep 1, 2026
@Amemeda Amemeda changed the title Replace AbstractFateStote.verifyReserved() with new method FateMutator.requireReserved() Replace AbstractFateStore.verifyReserved() with new method FateMutator.requireReserved() Sep 1, 2026
@Amemeda
Amemeda marked this pull request as ready for review September 3, 2026 17:50
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java Outdated
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java Outdated
@Amemeda
Amemeda requested a review from DomGarguilo September 8, 2026 20:35
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java Outdated
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java Outdated
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java Outdated
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/FateMutator.java Outdated

@dlmarion dlmarion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, I kicked off a full IT build to see if this causes any failures.

@dlmarion dlmarion left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserFateIT_SimpleSuite.testNoWriteAfterDelete failed. Please run locally to see if you can reproduce the failure and fix.

@Amemeda

Amemeda commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

I was able to reproduce the failure. The test was only failing on assertThrows(Exception.class, txStore::pop);, so updated UserFateStore.pop() by moving the create a new reserved fate mutator outside of the top.ifPresent(...), but kept the deleteRepo and mutate:

FateMutator<T> fateMutator = newReservedMutator().requireStatus(REQ_POP_STATUS.toArray(TStatus[]::new)); top.ifPresent(t -> fateMutator.deleteRepo(t).mutate());

The push method right above handles this the exact same way, the failing test is now passing locally.

@Amemeda
Amemeda requested a review from dlmarion September 29, 2026 17:04
Comment thread core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java Outdated
@dlmarion dlmarion added this to the 4.0.0 milestone Sep 30, 2026
@dlmarion
dlmarion merged commit 5646671 into apache:main Sep 30, 2026
8 checks passed
@Amemeda
Amemeda deleted the 4908-require-reserved branch September 30, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace AFS.verifyReserved with a condition

3 participants