Apache9 commented on pull request #4202: URL: https://github.com/apache/hbase/pull/4202#issuecomment-1066098689
> Maybe I'm missing it, but I think there's still a chance for race condition here. Let me try to summarize how I think you're solving this and you can correct me. > > We add a sequence id (the current timestamp or one more than the previous ID if we have a clock skew) for each store's tracker. This sequence id is included in the filename for uniqueness. When we write a new tracker out, we increment the id. When we go to load a store, we find the largest ID and pick that seqID's tracker file to load. After we pick the biggest seqId tracker, we delete any trackers older than the one we picked. > > * RS1 makes a tracker for storeA with seq=1 > * RS1 goes zombie > * RS2 gets assignment for storeA opens seq=2 > * RS1 wakes up and tries to memstore flush > > I'm confused because I feel like we will call `load(false)` which would just write a new tracker file with the newer time (or `seqId + 1`). I will totally admit I am probably just getting it by reading the code. Ah you have missed a very important point... We will only bump the sequence id when loading at the primary replica(i.e, readOnly = false), this means we will only bump the sequence id when opening a region, so the scenario you described above has no problem. RS1 will only write the files with old sequence id while RS2 will write the files with new(greater) sequence id. This is the key trick here to solve the problem. -- 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]
