keith-turner commented on PR #4204:
URL: https://github.com/apache/accumulo/pull/4204#issuecomment-1934388313

   What lead to the createAndReserve call was trying to deal with the following 
race condition when I was trying to sub out using this feature.
   
   ```java
   class Fate {
     seed(..., FateKey key,...) {
          var fateId = create(key);
          // another thread could sneak in here
           var fateTxStore = store.reserve(fateId);
           try{
               // between create and reserve, its possible something happened 
with the key so now that we hold the reservation check that things are as 
expected
               store.checkKeyIsStillSame(fateId,key);
           }finally{
               fateTxStore.unreserve();
          }
      }
   
   ```
   
   So hoping having the store create and reserve can avoid this.
   


-- 
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-unsubscr...@accumulo.apache.org

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

Reply via email to