Skip to content

Commit

Permalink
Merge #61540 #61561
Browse files Browse the repository at this point in the history
61540: sql: use stopper for virtual table row pushing go routine r=barryhe2000 a=barryhe2000

Previously, the row pushing go routine in virtual table
would not go through the stopper. Now it uses the stopper
to run an async task, allowing the stopper to help with
error handling.

Fixes: #60587 

Release justification: bug fix and low-risk update

Release note: None

61561: kvserver: remove multiTestContext r=lunevalex a=lunevalex

Closes #8299

With all the tests converted to use TestCluster/TestServer,
we can finally remove multiTestContext and all of the dependent
code.

Release note: None
Release justification: Cleans up unused test code.

Co-authored-by: Barry He <[email protected]>
Co-authored-by: Alex Lunev <[email protected]>
  • Loading branch information
3 people committed Mar 8, 2021
3 parents 7892e68 + 0d894be + 8560678 commit e9592f5
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 1,396 deletions.
3 changes: 0 additions & 3 deletions pkg/kv/kvserver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,10 @@ go_test(
"//pkg/config",
"//pkg/config/zonepb",
"//pkg/gossip",
"//pkg/gossip/resolver",
"//pkg/keys",
"//pkg/kv",
"//pkg/kv/kvclient",
"//pkg/kv/kvclient/kvcoord",
"//pkg/kv/kvclient/rangecache",
"//pkg/kv/kvserver/abortspan",
"//pkg/kv/kvserver/apply",
"//pkg/kv/kvserver/batcheval",
Expand Down Expand Up @@ -374,7 +372,6 @@ go_test(
"//pkg/util/timeutil",
"//pkg/util/tracing",
"//pkg/util/uuid",
"@com_github_cenkalti_backoff//:backoff",
"@com_github_cockroachdb_circuitbreaker//:circuitbreaker",
"@com_github_cockroachdb_cockroach_go//crdb",
"@com_github_cockroachdb_datadriven//:datadriven",
Expand Down
30 changes: 0 additions & 30 deletions pkg/kv/kvserver/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1763,36 +1763,6 @@ func TestStoreRangeUpReplicate(t *testing.T) {
}
}

// TestUnreplicateFirstRange verifies that multiTestContext still functions in
// the case where the first range (which contains range metadata) is
// unreplicated from the first store. This situation can arise occasionally in
// tests, as can a similar situation where the first store is no longer the lease holder of
// the first range; this verifies that those tests will not be affected.
// TODO(lunevalex): Remove this test when removing MTC, no need to convert it
func TestUnreplicateFirstRange(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

cfg := kvserver.TestStoreConfig(nil)
cfg.TestingKnobs.DisableReplicateQueue = true
mtc := &multiTestContext{storeConfig: &cfg}
defer mtc.Stop()
mtc.Start(t, 3)

const rangeID = roachpb.RangeID(1)
// Replicate the range to store 1.
mtc.replicateRange(rangeID, 1)
// Move the lease away from store 0 before removing its replica.
mtc.transferLease(context.Background(), rangeID, 0, 1)
// Unreplicate the from from store 0.
mtc.unreplicateRange(rangeID, 0)
require.NoError(t, mtc.waitForUnreplicated(rangeID, 0))
// Replicate the range to store 2. The first range is no longer available on
// store 1, and this command will fail if that situation is not properly
// supported.
mtc.replicateRange(rangeID, 2)
}

// TestChangeReplicasDescriptorInvariant tests that a replica change aborts if
// another change has been made to the RangeDescriptor since it was initiated.
func TestChangeReplicasDescriptorInvariant(t *testing.T) {
Expand Down
Loading

0 comments on commit e9592f5

Please sign in to comment.