Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: avoid crash in splitPostApply
See cockroachdb#39571. The above PR was incomplete because we also need to wind back the replicaID. I was able to confirm that this *actually* works by running tests with this diff, which simulates an incoming raft message reflecting a high replicaID just before the split gets applied. ```diff diff --git a/pkg/storage/replica_raft.go b/pkg/storage/replica_raft.go index 6d5a044657..981f3e1714 100644 --- a/pkg/storage/replica_raft.go +++ b/pkg/storage/replica_raft.go @@ -1525,7 +1525,7 @@ func (r *Replica) maybeAcquireSplitMergeLock( func (r *Replica) acquireSplitLock( ctx context.Context, split *roachpb.SplitTrigger, ) (func(), error) { - rightRng, _, err := r.store.getOrCreateReplica(ctx, split.RightDesc.RangeID, 0, nil) + rightRng, _, err := r.store.getOrCreateReplica(ctx, split.RightDesc.RangeID, 100, nil) if err != nil { return nil, err } ``` @danhhz is working on a real test for this, so we'll soon have end-to-end coverage. Fixes cockroachdb#39651. Release note: None
- Loading branch information