Skip to content

Commit 570ae4c

Browse files
committed
logictest: add retry before all ALTER TABLE EXPERIMENTAL_RELOCATE
In #139839 we added retries before various `ALTER TABLE EXPERIMENTAL_RELOCATE` statements. We're still seeing some failures, so add retries to more `ALTER TABLE EXPERIMENTAL_RELOCATE` statements. The following command was used to add the retries (via ChatGPT 5): ```bash git ls-files -z pkg/sql/logictest/testdata/logic_test/ pkg/sql/opt/exec/execbuilder/testdata/ pkg/ccl/logictestccl/testdata/logic_test/ \ | while IFS= read -r -d '' f; do awk ' BEGIN { seen_retry=0; have_pending=0; last_stmt_retry=0; bcount=0 } /retry/ { seen_retry=1 } /statement ok/ { if (have_pending) { for (i=1;i<=bcount;i++) print buf[i] } have_pending=1; bcount=0; last_stmt_retry=seen_retry; buf[++bcount]=$0; next } have_pending { buf[++bcount]=$0 if ($0 ~ /ALTER TABLE .* EXPERIMENTAL_RELOCATE/) { if (last_stmt_retry==0) print "retry" for (i=1;i<=bcount;i++) print buf[i] have_pending=0; bcount=0 } next } { print } END { if (have_pending) for (i=1;i<=bcount;i++) print buf[i] } ' "$f" > "$f.tmp" && mv "$f.tmp" "$f" done ``` Fixes: #151855 Release note: None
1 parent fdb5624 commit 570ae4c

25 files changed

+54
-4
lines changed

pkg/sql/logictest/testdata/logic_test/distsql_agg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ statement ok
88
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
99

1010
# Relocate the ten parts to the five nodes.
11+
retry
1112
statement ok
1213
ALTER TABLE data EXPERIMENTAL_RELOCATE
1314
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)
@@ -305,6 +306,7 @@ CREATE TABLE one (k INT PRIMARY KEY, v INT)
305306
statement ok
306307
ALTER TABLE one SPLIT AT VALUES (0), (99)
307308

309+
retry
308310
statement ok
309311
ALTER TABLE one EXPERIMENTAL_RELOCATE VALUES (ARRAY[1], 0)
310312

@@ -317,6 +319,7 @@ CREATE TABLE two (k INT PRIMARY KEY, v INT);
317319
statement ok
318320
ALTER TABLE two SPLIT AT VALUES (0), (99)
319321

322+
retry
320323
statement ok
321324
ALTER TABLE two EXPERIMENTAL_RELOCATE VALUES (ARRAY[2], 0)
322325

@@ -474,6 +477,7 @@ statement ok
474477
ALTER TABLE sorted_data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
475478

476479
# Relocate the ten parts to the five nodes.
480+
retry
477481
statement ok
478482
ALTER TABLE sorted_data EXPERIMENTAL_RELOCATE
479483
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)
@@ -614,6 +618,7 @@ statement ok
614618
ALTER TABLE statistics_agg_test SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
615619

616620
# Relocate the ten parts to the five nodes.
621+
retry
617622
statement ok
618623
ALTER TABLE statistics_agg_test EXPERIMENTAL_RELOCATE
619624
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)

pkg/sql/logictest/testdata/logic_test/distsql_crdb_internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ statement ok
88
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
99

1010
# Relocate the ten parts to the five nodes.
11+
retry
1112
statement ok
1213
ALTER TABLE data EXPERIMENTAL_RELOCATE
1314
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)

pkg/sql/opt/exec/execbuilder/testdata/dist_vectorize

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ ALTER TABLE kv SPLIT AT SELECT i FROM generate_series(1,5) AS g(i)
1919
statement ok
2020
ALTER TABLE kw SPLIT AT SELECT i FROM generate_series(1,5) AS g(i)
2121

22+
retry
2223
statement ok
2324
ALTER TABLE kv EXPERIMENTAL_RELOCATE SELECT ARRAY[i], i FROM generate_series(1, 5) as g(i)
2425

26+
retry
2527
statement ok
2628
ALTER TABLE kw EXPERIMENTAL_RELOCATE SELECT ARRAY[i], i FROM generate_series(1, 5) as g(i)
2729

pkg/sql/opt/exec/execbuilder/testdata/distsql_agg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ statement ok
88
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
99

1010
# Relocate the ten parts to the five nodes.
11+
retry
1112
statement ok
1213
ALTER TABLE data EXPERIMENTAL_RELOCATE
1314
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)
@@ -814,6 +815,7 @@ statement ok
814815
ALTER TABLE sorted_data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
815816

816817
# Relocate the ten parts to the five nodes.
818+
retry
817819
statement ok
818820
ALTER TABLE sorted_data EXPERIMENTAL_RELOCATE
819821
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)

pkg/sql/opt/exec/execbuilder/testdata/distsql_distinct_on

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ CREATE TABLE abc (
1919
statement ok
2020
ALTER TABLE xyz SPLIT AT VALUES (2), (4), (6), (7)
2121

22+
retry
2223
statement ok
2324
ALTER TABLE xyz EXPERIMENTAL_RELOCATE VALUES
2425
(ARRAY[1], 0),
@@ -35,6 +36,7 @@ ALTER TABLE abc SPLIT AT VALUES
3536
('2', '3', '4'),
3637
('3', '4', '5')
3738

39+
retry
3840
statement ok
3941
ALTER TABLE abc EXPERIMENTAL_RELOCATE VALUES
4042
(ARRAY[1], NULL, NULL, NULL),

pkg/sql/opt/exec/execbuilder/testdata/distsql_group_join

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ statement ok
88
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
99

1010
# Relocate the ten parts to the five nodes.
11+
retry
1112
statement ok
1213
ALTER TABLE data EXPERIMENTAL_RELOCATE
1314
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)

pkg/sql/opt/exec/execbuilder/testdata/distsql_inverted_index

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ ANALYZE json_tab
5757
statement ok
5858
ALTER TABLE json_tab SPLIT AT VALUES (10), (20)
5959

60+
retry
6061
statement ok
6162
ALTER TABLE json_tab EXPERIMENTAL_RELOCATE VALUES (ARRAY[1], 1), (ARRAY[2], 10), (ARRAY[3], 20)
6263

@@ -166,6 +167,7 @@ ANALYZE array_tab
166167
statement ok
167168
ALTER TABLE array_tab SPLIT AT VALUES (3), (3)
168169

170+
retry
169171
statement ok
170172
ALTER TABLE array_tab EXPERIMENTAL_RELOCATE VALUES (ARRAY[1], 1), (ARRAY[2], 3), (ARRAY[3], 5)
171173

pkg/sql/opt/exec/execbuilder/testdata/distsql_join

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ statement ok
88
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
99

1010
# Relocate the ten parts to the five nodes.
11+
retry
1112
statement ok
1213
ALTER TABLE data EXPERIMENTAL_RELOCATE
1314
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)

pkg/sql/opt/exec/execbuilder/testdata/distsql_merge_join

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ ALTER TABLE grandchild2 SPLIT AT SELECT pid1, pid1 + 40, pid1, pid1 FROM
9797
generate_series(2, 38, 4) AS g(pid1)
9898

9999
# Relocate the twenty parts to the five nodes.
100+
retry
100101
statement ok
101102
ALTER TABLE grandchild2 EXPERIMENTAL_RELOCATE
102103
SELECT ARRAY[((i-1)/2)::INT%5+1], i, i+20, i, i FROM generate_series(1, 39, 2) AS g(i)
@@ -746,6 +747,7 @@ statement ok
746747
ALTER TABLE outer_p1 SPLIT AT
747748
SELECT i FROM generate_series(0, 40, 5) AS g(i)
748749

750+
retry
749751
statement ok
750752
ALTER TABLE outer_p1 EXPERIMENTAL_RELOCATE
751753
SELECT ARRAY[(((i-3)/5)%4)::INT + 1], i FROM generate_series(3, 40, 5) AS g(i)

pkg/sql/opt/exec/execbuilder/testdata/distsql_misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ statement ok
6363
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i)
6464

6565
# Relocate the ten parts to the five nodes.
66+
retry
6667
statement ok
6768
ALTER TABLE data EXPERIMENTAL_RELOCATE
6869
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i)

0 commit comments

Comments
 (0)