CASSANDRA-21183 Safely regain ranges that were previously owned by a node#268
CASSANDRA-21183 Safely regain ranges that were previously owned by a node#268alanwang67 wants to merge 23 commits intoapache:trunkfrom
Conversation
| return additions; | ||
| } | ||
|
|
||
| public List<Long> epochsWeAreRegainingRangesFor(Topology curr, Topology next) |
There was a problem hiding this comment.
I think this and block... aren't used, so could remove them (and the associated notify)?
| * But they may still be ordered for other key ranges they participate in. | ||
| */ | ||
| private NavigableMap<Timestamp, Ranges> safeToRead = emptySafeToRead(); | ||
| private Ranges retiredRanges = Ranges.EMPTY; |
There was a problem hiding this comment.
We probably don't need this; we can simply query redundantBefore, as this won't happen on any fast paths
There was a problem hiding this comment.
Maybe I should come up with a better name, but this variable is for keeping track of the ranges that we marked as unsafe to read in the CommandStore because we are regaining the range for it, so it is a subset of the actual retiredRanges. I use this value to ensure that whenever we set ranges as safeToRead we exclude these ranges as it is no longer safe to read from them if there exists a CommandStore with a greater epoch that has the same range. If we query redundantBefore, I'm not sure if we will be able to get this value.
Currently nodes that are regaining ranges can result in subtle edge cases when we still have command stores left over from previous epochs that overlap with the range we are regaining.
To address this we:
setSafeToReadinvocations to revert this change.