keith-turner edited a comment on issue #2031:
URL: https://github.com/apache/accumulo/issues/2031#issuecomment-826973456


   One way to do this sanity check and handle race conditions is to have a one 
up update counter for each tablet that is used to detect race conditions.  Each 
tablet could update this counter prior to writing to the metadata table.  
Tablet servers could do the following when doing the sanity check.
   
    1. For each tablet on the tserver get its current update counter, storing 
this in a map like `Map<KeyExtent, Long>`
    2. For each tablet get its metadata from the metadata table, storing this 
in a map like `Map<KeyExtent, TabletMetadata>`
    3. For each tablet call a method to check consistency passing in the 
previously acquired update counter and TabletMetadata.  The tablet could then 
do the following.
         1. Get the tablet lock
         2. Check if the passed in update counter matches the current update 
counter.  If not return something to the tserver code indicating a retry is 
needed for the tablet.
         3. Check if the passed in TabletMetadata matches what the tablet 
currently has in memory.
   


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