diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 8eda6a6..d2827ec 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -21,6 +21,7 @@ jobs: - '8.0.42' - '8.4.4' - '9.1.0' + - '9.5.0' env: GO111MODULE: on SANDBOX_BINARY: ${{ github.workspace }}/opt/mysql diff --git a/cmd/export_test.go b/cmd/export_test.go index 449fff7..3ee3fce 100644 --- a/cmd/export_test.go +++ b/cmd/export_test.go @@ -93,7 +93,7 @@ func TestExportImport(t *testing.T) { subCommandName: "", expectedName: "admin", expectedAncestors: 2, - expectedSubCommands: 6, + expectedSubCommands: 7, expectedArgument: "", }, { diff --git a/sandbox/templates/replication/check_multi_source.gotxt b/sandbox/templates/replication/check_multi_source.gotxt index d69880d..510b823 100644 --- a/sandbox/templates/replication/check_multi_source.gotxt +++ b/sandbox/templates/replication/check_multi_source.gotxt @@ -12,7 +12,7 @@ do port=$($SBDIR/{{.NodeLabel}}$M/use -BN -e "show variables like 'port'") server_id=$($SBDIR/{{.NodeLabel}}$M/use -BN -e "show variables like 'server_id'") echo "$port - $server_id" - $SBDIR/{{.NodeLabel}}$M/use -e '{{.ShowMasterStatus}}\G' | grep "File\|Position\|Executed" + $SBDIR/{{.NodeLabel}}$M/use --vertical -e '{{.ShowMasterStatus}}' | grep "File\|Position\|Executed" done for S in $SLAVES do @@ -20,5 +20,5 @@ do port=$($SBDIR/{{.NodeLabel}}$S/use -BN -e "show variables like 'port'") server_id=$($SBDIR/{{.NodeLabel}}$S/use -BN -e "show variables like 'server_id'") echo "$port - $server_id" - $SBDIR/{{.NodeLabel}}$S/use -e '{{.ShowSlaveStatus}}\G' | grep -E "(Running:|Master_Log_Pos|Source_Log_Pos|\ $master_status -master_binlog=$(grep 'File:' $master_status | awk '{print $2}' ) -master_pos=$(grep 'Position:' $master_status | awk '{print $2}' ) +$MASTER --vertical -e '{{.ShowMasterStatus}}' > $master_status +master_binlog=$(grep -E '^\s*(File|Log_name):' $master_status | awk '{print $2}' ) +master_pos=$(grep -E '^\s*Position:' $master_status | awk '{print $2}' ) echo "# {{.MasterLabel}} log: $master_binlog - Position: $master_pos - Rows: $MASTER_RECS" rm -f $master_status @@ -98,7 +98,13 @@ do then sleep 3 else - S_READY=$($SLAVE -BN -e "select {{.MasterPosWaitFunc}}('$master_binlog', $master_pos,60)") + if [ -z "$master_binlog" ] || [ -z "$master_pos" ]; then + echo "# WARNING: could not determine master binlog/position, using GTID wait" + sleep 3 + S_READY=0 + else + S_READY=$($SLAVE -BN -e "select {{.MasterPosWaitFunc}}('$master_binlog', $master_pos, 60)") + fi # master_pos_wait can return 0 or a positive number for successful replication # Any result that is not NULL or -1 is acceptable if [ "$S_READY" != "-1" -a "$S_READY" != "NULL" ] @@ -109,7 +115,7 @@ do fi if [ -f initialize_{{.SlaveLabel}}s ] then - $SLAVE -e '{{.ShowSlaveStatus}}\G' > $slave_status + $SLAVE --vertical -e '{{.ShowSlaveStatus}}' > $slave_status IO_RUNNING=$(grep -E -w "Slave_IO_Running|Replica_IO_Running" $slave_status | awk '{print $2}') ok_equal $IO_RUNNING Yes "{{.SlaveLabel}} #$SLAVE_N IO thread is running" SQL_RUNNING=$(grep -E -w "Slave_SQL_Running|Replica_SQL_Running" $slave_status | awk '{print $2}') diff --git a/sandbox/templates/single/replicate_from.gotxt b/sandbox/templates/single/replicate_from.gotxt index 5409bfd..1d86ce8 100644 --- a/sandbox/templates/single/replicate_from.gotxt +++ b/sandbox/templates/single/replicate_from.gotxt @@ -164,7 +164,7 @@ then show_master_status_cmd="show binary log status" fi -$master_use_script -e "$show_master_status_cmd\G" > $master_status +$master_use_script --vertical -e "$show_master_status_cmd" > $master_status binlog_file=$(grep File < $master_status | awk '{print $2}') binlog_pos=$(grep Position < $master_status | awk '{print $2}') rm -f $master_status @@ -270,7 +270,7 @@ then stop_reset_cmd="stop replica; reset replica" fi $SBDIR/use -v -e "$start_replica_cmd" -$SBDIR/use -v -e "$show_replica_cmd\G" | grep "\(Running:\|Master_Log_Pos\|Source_Log_Pos\|\ $active_replication echo "Connected to $master_path" >> $active_replication echo "#!{{.ShellPath}}" > $remove_replication