Skip to content

Commit 3b35d3b

Browse files
committed
kvserver: add two r.mu.Unlock before Fatal
Just for hygiene.
1 parent 9397945 commit 3b35d3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/kv/kvserver/replica_raftstorage.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,10 @@ func (r *Replica) applySnapshot(
642642
if isInitialSnap {
643643
// NB: this will also call setDescLockedRaftMuLocked.
644644
if err := r.initFromSnapshotLockedRaftMuLocked(ctx, desc); err != nil {
645+
r.mu.Unlock()
645646
log.Fatalf(ctx, "unable to initialize replica while applying snapshot: %+v", err)
646647
} else if err := r.store.markReplicaInitializedLockedReplLocked(ctx, r); err != nil {
648+
r.mu.Unlock()
647649
log.Fatalf(ctx, "unable to mark replica initialized while applying snapshot: %+v", err)
648650
}
649651
} else {

0 commit comments

Comments
 (0)