From 054538fd7d087b7ac9548f7d198b078dfe9c787b Mon Sep 17 00:00:00 2001 From: Nick Travers Date: Thu, 11 Jul 2024 22:16:08 +0000 Subject: [PATCH] roachtest: fix multi-store-remove 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. --- pkg/cmd/roachtest/tests/multi_store_remove.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/cmd/roachtest/tests/multi_store_remove.go b/pkg/cmd/roachtest/tests/multi_store_remove.go index 877cef483d19..6cad0374b69f 100644 --- a/pkg/cmd/roachtest/tests/multi_store_remove.go +++ b/pkg/cmd/roachtest/tests/multi_store_remove.go @@ -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, @@ -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) }