Skip to content

Commit 3f3b72c

Browse files
author
Srikanth B R
committed
Bug30799097 MTR: ADD SUPPORT TO STOP AND START SECONDARY ENGINE SERVERS WITHIN TESTS
Issue ===== If one or more secondary engine server nodes go down during execution of a test, it is interpreted as a failure. However, there may be cases where one actually wants to stop and possibly restart one or more secondary engine servers intentionally. Fix === A mechanism to let the system know if the test expects secondary server(s) to terminate, and to either wait or have it restarted immediately has been implemented. Before the action that will stop the server is initiated, the test case should write either "wait" or "restart" to the file "$MYSQLTEST_VARDIR/tmp/<secondary_server_name>.<server_id>.expect". If "restart" is written into this file, the server will be immediately restarted. If "wait" is written instead, the server will remain down, but can be restarted at a later time by writing "restart" to the same file. In addition, the patch also includes writing the PID of the safe_process instance for each secondary engine server (i.e., the process which spawns and monitors the secondary engine server's process) to a file in the MTR run directory i.e., "$MYSQLTEST_VARDIR/run/<secondary_server_name>.<server_id>.pid". This can inturn be used to terminate an individual secondary server process within tests by sending an appropriate signal. Change-Id: I3c4d4a810f7389d06f8a3b3134fbc54a2bfae416
1 parent 310d8be commit 3f3b72c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mysql-test/mysql-test-run.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5553,7 +5553,7 @@ ($)
55535553
return $res if $res;
55545554
}
55555555

5556-
# Loop through our list of processes and look for and entry with the
5556+
# Loop through our list of processes and look for an entry with the
55575557
# provided pid, if found check for the file indicating expected crash
55585558
# and restart it.
55595559
sub check_expected_crash_and_restart($$) {
@@ -5631,6 +5631,10 @@ ($$)
56315631
}
56325632
}
56335633

5634+
if ($tinfo->{'secondary-engine'}) {
5635+
return check_expected_secondary_server_crash_and_restart($proc, $tinfo);
5636+
}
5637+
56345638
# Not an expected crash
56355639
return 0;
56365640
}

0 commit comments

Comments
 (0)