EdColeman commented on pull request #1962:
URL: https://github.com/apache/accumulo/pull/1962#issuecomment-793181218


   @dlmarion - thinking about this, there is only one edge case where a 
sequential, ephemeral node would ever find a node with a lower sequential 
number that was created "after" the current node.  The sequential numbers are 
assigned based on the parent, so each child node is created with a 1-up number. 
 For a lowered numbered node to wink into existence it would take something 
like, (and hopefully zookeeper prevents this):
    
   ```
   process A creates a sequential node - this reserves the number, but the node 
is not "created" yet.
   process B creates a sequential node - this reserves the "next, higher" 
number`, the node IS created.
   time passes...
   the node created by A comes into existence.
   ```
   If zookeeper protects against this by atomically assigning a sequential 
number and creating the node, then if you create a sequential node, sequential 
nodes with lower numbers either exist - or if they don't they can never be 
recreated using the zookeeper sequential API. Any subsequent sequential nodes 
created will always have a higher sequential number, never lower.
   
   The sequential numbers always increasing is baked into zookeeper and 
fundamental to the leader election recipe.  So, if you have a sequential node 
and look for nodes with lower numbers, they either exist or they never will.  
If you checked for existence and then added the watcher the only edge case 
would be if the node was deleted between the check and the watch add - in which 
case we'd probably want to remove the watcher.


----------------------------------------------------------------
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.

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


Reply via email to