Skip to content

Commit 06edb41

Browse files
committed
kvserver: don't proceed with unsafe replication changes after 10s
`within10s` is called from within the change replicas txn as a last layer of defense against replication changes that would lose quorum. While looking into cases in which precisely this happened, I wondered why this last line of defense couldn't block these ill-advised changes. It turns out that within10s had a bug: it would return without an error. In effect, it wasn't doing anything except delay the problematic change. This bug is mine - introduced almost five years ago in #57564. Consequently, it's present in "all" versions of CockroachDB. Release note(bug fix): A mechanism that blocks replication changes that would result in a loss of quorum was ineffective. It now works as intended.
1 parent b97d3b3 commit 06edb41

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/kv/kvserver/replica_command.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,9 @@ func within10s(ctx context.Context, fn func() error) error {
24022402
return nil
24032403
}
24042404
}
2405+
if err != nil {
2406+
return err
2407+
}
24052408
return ctx.Err()
24062409
}
24072410

0 commit comments

Comments
 (0)