keith-turner commented on code in PR #4524:
URL: https://github.com/apache/accumulo/pull/4524#discussion_r1597514630


##########
core/src/main/java/org/apache/accumulo/core/fate/user/UserFateStore.java:
##########
@@ -150,6 +150,39 @@ protected void create(FateId fateId, FateKey fateKey) {
         + " and fateKey " + fateKey + " after " + maxAttempts + " attempts");
   }
 
+  @Override
+  public Optional<FateTxStore<T>> tryReserve(FateId fateId) {
+    // TODO 4131 should this throw an exception if the id doesn't exist 
(status = UNKNOWN)?
+    FateMutator.Status status = 
newMutator(fateId).putReservedTx(fateId).tryMutate();

Review Comment:
   The manager lock is 
[here](https://github.com/apache/accumulo/blob/0edc48f910f25e5273d62b1d91a7993bf9529b8e/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java#L217)
 and from that can access 
[ServiceLock.getLockID()](https://github.com/apache/accumulo/blob/0edc48f910f25e5273d62b1d91a7993bf9529b8e/core/src/main/java/org/apache/accumulo/core/lock/ServiceLock.java#L594)
 and 
[ServiceLock.isLockHeld()](https://github.com/apache/accumulo/blob/0edc48f910f25e5273d62b1d91a7993bf9529b8e/core/src/main/java/org/apache/accumulo/core/lock/ServiceLock.java#L654).
  So can persist the LockId w/ reservations, although not sure of the best way 
to do that.  Then the periodic test that looks for reservations held by dead 
processes it can call ServiceLock.isLockHeld.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to