-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storage: Re-enable storeReplicaRaftReadyConcurrency #7846
Comments
The race between two uninitialized ranges applying snapshots exists regardless of concurrency settings; see #7830 |
Dividing the replicas to process into initialized and uninitialized sets would be straightforward, but leaving this important aspect of |
What important aspect do you mean (i.e. what's the dangerous alternative)? I feel ok about this purely from the Raft perspective. The Store is in charge of making sure each Replica is always alone on its keyspace, so it needs to be the one which tells replicas when it's safe to write to disk. OTOH (and this is somewhat out of scope for this issue), we have various moving parts holding on to replicas outside of the Raft processing loop (scanner queues, reads, etc). Even pre-Raft, operations pass through |
Naively, I would expect The more dangerous alternative is to try and replace |
Again, not the right issue, but I wanted to dump two other observations:
The second point brings me back towards the previous post: How does the store make sure the What about replicaGC? We
I'm fairly sure this means that any reads which are pending at the time a replica is removed might get blocked at some random point (perhaps on I think a combination of making sure all engine writes on |
Hmm, isn't the contract for
But From my understanding of these moving parts, what Ben suggests makes a lot of sense. |
Hmm, maybe the snapshot could also return a side effect from This moves some of the state machine stuff up to Store (i.e. the Replica only applies a |
Currently yes, but a
Yes, that makes sense. If only all access to replicas was coordinate through |
It makes more sense phrased that way, to block
The queues should probably hold
I've had similar thoughts, but this probably belongs in #6144. |
Only initialized replicas are safe to parallelize, so process all uninitialized replicas before starting goroutines for the initialized ones. Fixes cockroachdb#7846
Only initialized replicas are safe to parallelize, so process all uninitialized replicas before starting goroutines for the initialized ones. Fixes cockroachdb#7846
This was disabled in #7673 due to concerns raised in #7672. It was a big performance improvement, so we should figure out how to turn it back on.
It should always be possible to process initialized replicas concurrently - they are guaranteed to address disjoint parts of the keyspace. The only possible interference is between an initialized and uninitialized replica (the uninitialized replica writing a HardState as the initialized one splits), or between two uninitialized replicas (both applying snapshots, one pre-split and one post-split).
Therefore I believe we can fix the races by processing all uninitialized replicas one at a time, then processing the initialized replicas in parallel.
The text was updated successfully, but these errors were encountered: