Debian Codegraph @

mysql-test/suite/ndb/include/restart_node.inc

raw
1 ##
2 ## Restarts a single NDB data node
3 ##
4 ## Parameters:
5 ## $ndb_node_id - The node to be restarted
6 ## $waiter_timeout_start - How long wo tait for a single node to start, default 120 seconds
7 ## $waiter_timeout_stop - How long to wait for a single node to stop, default 60 seconds
8 ##
9
10 # Default values
11 if (`SELECT LENGTH('$waiter_timeout_start') = 0`) {
12 let $waiter_timeout_start= 120;
13 }
14 if (`SELECT LENGTH('$waiter_timeout_stop') = 0`) {
15 let $waiter_timeout_stop= 60;
16 }
17
18 --echo # Restarting node $ndb_node_id, timeouts: start: $waiter_timeout_start seconds, stop: $waiter_timeout_stop seconds:
19
20 --append_file $NDB_TOOLS_OUTPUT
21 # Restarting random node, stopping part:
22 EOF
23 --exec $NDB_MGM -e "show" >> $NDB_TOOLS_OUTPUT
24 --exec $NDB_MGM -e "$ndb_node_id restart -n" >> $NDB_TOOLS_OUTPUT
25 --exec $NDB_WAITER --wait-nodes=$ndb_node_id --not-started --timeout=$waiter_timeout_stop >> $NDB_TOOLS_OUTPUT
26
27 --append_file $NDB_TOOLS_OUTPUT
28 # Restarting random node, starting part:
29 EOF
30 --exec $NDB_MGM -e "show" >> $NDB_TOOLS_OUTPUT
31 --exec $NDB_MGM -e "$ndb_node_id start" >> $NDB_TOOLS_OUTPUT
32 --exec $NDB_WAITER --timeout=$waiter_timeout_start >> $NDB_TOOLS_OUTPUT
33 --exec $NDB_MGM -e "show" >> $NDB_TOOLS_OUTPUT