Skip to content

Commit

Permalink
roachtest: fix multi-store-remove
Browse files Browse the repository at this point in the history
The intention of the test is to compare the number of ranges (multiplied
by the replication factor) to the _sum_ of replicas across all stores.
The current implementation is incorrect, as it compares range count to
store count.

Fix the test by using a `sum` of replicas across each store, rather than
a `count`, which will return the number of stores.

Fix #123989.

Release note: None.
  • Loading branch information
nicktrav committed Jul 11, 2024
1 parent e2cd0f3 commit a18c1b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/cmd/roachtest/tests/multi_store_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const (
func registerMultiStoreRemove(r registry.Registry) {
r.Add(registry.TestSpec{
Name: "multi-store-remove",
Skip: "#123989",
Owner: registry.OwnerStorage,
Cluster: r.MakeClusterSpec(multiStoreNodes, spec.SSD(multiStoreStoresPerNode)),
CompatibleClouds: registry.OnlyGCE,
Expand Down Expand Up @@ -144,7 +143,7 @@ func runMultiStoreRemove(ctx context.Context, t test.Test, c cluster.Cluster) {
if err := conn.QueryRowContext(ctx,
`SELECT
(SELECT count(1) FROM crdB_internal.ranges) AS ranges
, (SELECT count(range_count) FROM crdb_internal.kv_store_status) AS replicas`,
, (SELECT sum(range_count) FROM crdb_internal.kv_store_status) AS replicas`,
).Scan(&ranges, &replicas); err != nil {
t.Fatalf("replication status: %s", err)
}
Expand Down

0 comments on commit a18c1b7

Please sign in to comment.