Skip to content

Commit 5e50db7

Browse files
committed
roachtest: more patience in change-replicas/mixed-version
When moving replicas off a node (via zone configs), we need to be prepared to wait upwards of ten minutes (which is the default scanner interval, i.e. the frequency with which a range is checked for relocation). Fixes #150796. Fixes #150677 (via the backport). Fixes #149733 (via the backport). Epic: none
1 parent 9919801 commit 5e50db7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/cmd/roachtest/tests/mixed_version_change_replicas.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ func runChangeReplicasMixedVersion(ctx context.Context, t test.Test, c cluster.C
141141
}
142142

143143
var rangeCount int
144+
// We try for at least 80*9s = 12m to move replicas off of the node. The
145+
// scanner interval defaults to 10 minutes, so we can't reliably expect
146+
// this to go through much faster, though often it does.
144147
for i := 0; i < 80; i++ {
145148
err := h.QueryRow(r, `SELECT count(*) FROM `+
146149
`[SHOW RANGES FROM TABLE test] WHERE $1::int = ANY(replicas)`, node).Scan(&rangeCount)
@@ -156,7 +159,7 @@ func runChangeReplicasMixedVersion(ctx context.Context, t test.Test, c cluster.C
156159
return err
157160
}
158161
}
159-
time.Sleep(3 * time.Second)
162+
time.Sleep(9 * time.Second)
160163
}
161164
if rangeCount > 0 {
162165
return errors.Errorf("n%d still has %d replicas", node, rangeCount)

0 commit comments

Comments
 (0)