You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "kevinrr888 (via GitHub)" <gi...@apache.org> on 2024/10/17 14:27:45 UTC

[PR] Improvements to reservation column in FATE table and bug fix [accumulo]

kevinrr888 opened a new pull request, #4992:
URL: https://github.com/apache/accumulo/pull/4992

   This PR
   * Makes it so the reservation column is created on reservation and deleted on unreservation (no longer store an unreserved value in the column)
   * Addresses a bug with `MultipleStoresIT.testDeadReservationsCleanup()` (`ZooUtil.LockID` was missing `equals()` and `hashCode()`) (see NOTE)
   
   NOTE about original bug when I first attempted these changes:
   After making the reservation column changes, I tested `testDeadReservationsCleanup()` to see if I could recreate the same bug noted in this thread https://github.com/apache/accumulo/pull/4524#discussion_r1670884720 (TLDR - <4 transactions would show as being reserved, even though 4 threads were working on 4 transactions). I was able to recreate the bug (extremely rarely until I messed with the `DeadReservationCleaner` timings), but found that it is not related to the reservation column changes and is instead just a bug with the test. I'm not sure why I only saw this bug with the column changes the first go-around, but regardless it's fixed now. I was concerned if this was a bug with the code, but turns out it was just a problem with the test. The issue was the dead reservation cleaner was removing transactions that weren't dead because the `isLockHeld` predicate being passed was:
   `final Predicate<ZooUtil.LockID> isLockHeld = liveLocks::contains;`
   where
   `final Set<ZooUtil.LockID> liveLocks = new HashSet<>();`
   `ZooUtil.LockID` did not have `equals()` or `hashCode()` methods resulting in transactions being unexpectedly unreserved by the dead reservation cleaner.
   The real code (the Manager code) never calls equals on the LockID object, so this was just a bug with the test.
   
   closes #4907


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improvements to reservation column in FATE table and bug fix [accumulo]

Posted by "keith-turner (via GitHub)" <gi...@apache.org>.
keith-turner commented on code in PR #4992:
URL: https://github.com/apache/accumulo/pull/4992#discussion_r1806969239


##########
core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java:
##########
@@ -231,7 +228,9 @@ public Optional<FateTxStore<T>> tryReserve(FateId fateId) {
     // Create a unique FateReservation for this reservation attempt
     FateReservation reservation = FateReservation.from(lockID, UUID.randomUUID());
 
-    FateMutator.Status status = newMutator(fateId).putReservedTx(reservation).tryMutate();
+    // requiring any status prevents creating an entry if the fate id doesn't exist
+    FateMutator.Status status =

Review Comment:
   Nice comment here.  Interesting, I suppose the status check was not needed previously because it was assumed the reservation column always existed if the fate operation existed. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improvements to reservation column in FATE table and bug fix [accumulo]

Posted by "kevinrr888 (via GitHub)" <gi...@apache.org>.
kevinrr888 commented on code in PR #4992:
URL: https://github.com/apache/accumulo/pull/4992#discussion_r1808904236


##########
core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java:
##########
@@ -231,7 +228,9 @@ public Optional<FateTxStore<T>> tryReserve(FateId fateId) {
     // Create a unique FateReservation for this reservation attempt
     FateReservation reservation = FateReservation.from(lockID, UUID.randomUUID());
 
-    FateMutator.Status status = newMutator(fateId).putReservedTx(reservation).tryMutate();
+    // requiring any status prevents creating an entry if the fate id doesn't exist
+    FateMutator.Status status =

Review Comment:
   Yeah, before this, `putReservedTx` only worked if the reservation column had a NOT_RESERVED value, which was only set on creation and unreservation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improvements to reservation column in FATE table and bug fix [accumulo]

Posted by "kevinrr888 (via GitHub)" <gi...@apache.org>.
kevinrr888 merged PR #4992:
URL: https://github.com/apache/accumulo/pull/4992


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org