Skip to content
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

release-20.1: kv: deflake TestInitRaftGroupOnRequest #47664

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/kv/kvserver/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3914,6 +3914,12 @@ func TestInitRaftGroupOnRequest(t *testing.T) {
defer leaktest.AfterTest(t)()
storeCfg := kvserver.TestStoreConfig(nil /* clock */)
storeCfg.TestingKnobs.DisableMergeQueue = true
// Disable async intent resolution. This can lead to flakiness in the test
// because it allows for the intents written by the split transaction to be
// resolved at any time, including after the nodes are restarted. The intent
// resolution on the RHS's local range descriptor can both wake up the RHS
// range's Raft group and result in the wrong replica acquiring the lease.
storeCfg.TestingKnobs.IntentResolverKnobs.DisableAsyncIntentResolution = true
mtc := &multiTestContext{
storeConfig: &storeCfg,
// TODO(andrei): This test was written before multiTestContexts started with
Expand Down Expand Up @@ -3945,6 +3951,8 @@ func TestInitRaftGroupOnRequest(t *testing.T) {
mtc.restart()

// Get replica from the store which isn't the leaseholder.
// NOTE: StoreID is 1-indexed and storeIdx is 0-indexed, so despite what
// this might look like, this is grabbing the replica without the lease.
storeIdx := int(lease.Replica.StoreID) % len(mtc.stores)
if repl = mtc.stores[storeIdx].LookupReplica(roachpb.RKey(splitKey)); repl == nil {
t.Fatal("replica should not be nil for RHS range")
Expand Down