You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: localtests/move-tables/resume-panic-before-drain-complete/test.sh
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -76,14 +76,22 @@ if [ $? -gt 0 ]; then
76
76
return 1
77
77
fi
78
78
79
-
# validate last checkpoint (cutover started and drain GTID are set)
80
-
cutover_started=$(mysql-exec target primary $database -Ne "SELECT gh_ost_move_tables_cutover_started FROM _${table_name}_ghk ORDER BY gh_ost_chk_id DESC LIMIT 1;")
79
+
# validate last checkpoint (cutover started and drain GTID are set). The
80
+
# checkpoint table is named from the run token (_gho_<token>_ghk), so look it up
81
+
# by pattern rather than a static per-table name.
82
+
checkpoint_table=$(mysql-exec target primary $database -sNe "SELECT table_name FROM information_schema.tables WHERE table_schema='${database}' AND table_name LIKE '\\_gho\\_%\\_ghk' LIMIT 1;")
83
+
if [ -z"$checkpoint_table" ];then
84
+
echo"ERROR: Checkpoint table does not exist."
85
+
return 1
86
+
fi
87
+
88
+
cutover_started=$(mysql-exec target primary $database -Ne "SELECT gh_ost_move_tables_cutover_started FROM \`${checkpoint_table}\` ORDER BY gh_ost_chk_id DESC LIMIT 1;")
81
89
if [ "$cutover_started"!= 1 ];then
82
90
echo"ERROR: Expected cutover started to be set in last checkpoint."
83
91
return 1
84
92
fi
85
93
86
-
drain_gtid=$(mysql-exec target primary $database -Ne "SELECT gh_ost_move_tables_drain_gtid FROM _${table_name}_ghk ORDER BY gh_ost_chk_id DESC LIMIT 1;")
94
+
drain_gtid=$(mysql-exec target primary $database -Ne "SELECT gh_ost_move_tables_drain_gtid FROM \`${checkpoint_table}\` ORDER BY gh_ost_chk_id DESC LIMIT 1;")
87
95
if [ "$drain_gtid"=="" ];then
88
96
echo"ERROR: Expected drain GTID to be set in last checkpoint."
0 commit comments