Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent post-removal activity on range
as observed in cockroachdb#2593, the following could happen: * client proposes command to raft, waits * command commits, but hasn't reached client yet * group gets removed, triggering the waiting client * client decides the request is done, leaves * committed command executes * r.pendingCmds still holds the command, so the contained trace panics (use-after-finalize). The issue here is that `Replica`, `Store` and `Raft` are moving parts, that can't fully move in lockstep with the removal. (the store provides the Raft storage, so you can't remove the group under the lock). Instead, this change first "quiesces" the Replica, after which it can be dropped from Raft, and, finally, from `Store`.
- Loading branch information