Skip to content

Commit b5210c3

Browse files
committed
test: improve SST progress test with large table and specific value patterns
- Use manticore-load to create table with 100k docs for slower SST - Run JOIN in background to check progress during transfer - Replace generic patterns with specific ones matching task requirements - Simplify comments for better readability
1 parent 587fd47 commit b5210c3

File tree

1 file changed

+23
-30
lines changed

1 file changed

+23
-30
lines changed

test/clt-tests/replication/test-sst-progress.rec

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
––– comment –––
2-
Test for SST (State Snapshot Transfer) progress monitoring during table replication
3-
Issue: https://github.com/manticoresoftware/effyis/issues/390
4-
5-
Problem: When adding a large table to cluster via ALTER CLUSTER ADD, there was no way
6-
to track replication progress. Users couldn't determine how much was copied or remaining.
7-
8-
Solution: Added SST progress variables to SHOW STATUS:
9-
- cluster_<name>_sst_total: Overall progress (0-100)
10-
- cluster_<name>_sst_stage: Current stage (e.g., "send files")
11-
- cluster_<name>_sst_stage_total: Progress of current stage (0-100)
12-
- cluster_<name>_sst_tables: Total tables being transferred
13-
- cluster_<name>_sst_table: Current table being transferred (e.g., "3 (products)")
14-
- cluster_<name>_node_state: Node state (donor/joiner/synced)
15-
16-
This test validates that SST progress variables exist in SHOW STATUS output.
2+
Test SST progress variables in SHOW STATUS
173
––– input –––
184
apt-get update -y > /dev/null; echo $?
195
––– output –––
@@ -55,10 +41,19 @@ mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_status'\G"
5541
Counter: cluster_sst_test_status
5642
Value: primary
5743
––– comment –––
58-
Create simple table and add to cluster
44+
Create large table with data using manticore-load
5945
––– input –––
60-
mysql -h0 -P1306 -e "CREATE TABLE test_table (id bigint, title text)"
46+
manticore-load --quiet --json --init="CREATE TABLE test_table (id bigint, title text, age int)" --load="INSERT INTO test_table (id, title, age) VALUES (<increment>, '<text/10/50>', <int/1/100>)" --batch-size=1000 --threads=1 --total=100000
6147
––– output –––
48+
{
49+
"threads": #!/[0-9]+/!#,
50+
"batch_size": #!/[0-9]+/!#,
51+
"time": "#!/[0-9]+:[0-9]+/!#",
52+
"documents": #!/[0-9]+/!#,
53+
"documents_per_second": #!/[0-9]+/!#
54+
}
55+
––– comment –––
56+
Add large table to cluster
6257
––– input –––
6358
mysql -h0 -P1306 -e "ALTER CLUSTER sst_test ADD test_table"
6459
––– output –––
@@ -84,58 +79,56 @@ if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /var/log/manticore
8479
––– output –––
8580
Buddy started!
8681
––– comment –––
87-
Join node 2 to cluster - this triggers SST
82+
Join node 2 to cluster in background - this triggers SST
8883
––– input –––
89-
mysql -h0 -P2306 -e "JOIN CLUSTER sst_test AT '127.0.0.1:1312'"
84+
mysql -h0 -P2306 -e "JOIN CLUSTER sst_test AT '127.0.0.1:1312'" &
9085
––– output –––
9186
––– comment –––
92-
Verify SST progress variables exist on donor node
93-
The main goal is to check that these variables are available, not their specific values
87+
Check SST progress immediately while transfer is happening
9488
––– input –––
95-
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_node_state'\G"
89+
sleep 0.5; mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_node_state'\G"
9690
––– output –––
9791
*************************** 1. row ***************************
9892
Counter: cluster_sst_test_node_state
99-
Value: #!/.+/!#
93+
Value: #!/(donor|joiner|synced)/!#
10094
––– comment –––
10195
Verify all 5 SST progress variables exist
10296
––– input –––
10397
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_sst_%'\G" | grep "Counter:" | wc -l
10498
––– output –––
10599
5
106100
––– comment –––
107-
Check that each individual SST variable exists
108-
Values will be "-" if SST completed, or numbers/stage names if still active
101+
Verify individual SST variables
109102
––– input –––
110103
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_sst_total'\G"
111104
––– output –––
112105
*************************** 1. row ***************************
113106
Counter: cluster_sst_test_sst_total
114-
Value: #!/.*/!#
107+
Value: #!/([0-9]{1,2}|100|-)/!#
115108
––– input –––
116109
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_sst_stage'\G"
117110
––– output –––
118111
*************************** 1. row ***************************
119112
Counter: cluster_sst_test_sst_stage
120-
Value: #!/.*/!#
113+
Value: #!/([a-z ]+|-)/!#
121114
––– input –––
122115
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_sst_stage_total'\G"
123116
––– output –––
124117
*************************** 1. row ***************************
125118
Counter: cluster_sst_test_sst_stage_total
126-
Value: #!/.*/!#
119+
Value: #!/([0-9]{1,2}|100|-)/!#
127120
––– input –––
128121
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_sst_tables'\G"
129122
––– output –––
130123
*************************** 1. row ***************************
131124
Counter: cluster_sst_test_sst_tables
132-
Value: #!/.*/!#
125+
Value: #!/([0-9]+|-)/!#
133126
––– input –––
134127
mysql -h0 -P1306 -e "SHOW STATUS LIKE 'cluster_sst_test_sst_table'\G"
135128
––– output –––
136129
*************************** 1. row ***************************
137130
Counter: cluster_sst_test_sst_table
138-
Value: #!/.*/!#
131+
Value: #!/([0-9]+ \([a-z_]+\)|-)/!#
139132
––– comment –––
140133
Verify both nodes are synced
141134
––– input –––

0 commit comments

Comments
 (0)