Debian Codegraph @

mysql-test/suite/ndb/t/ndb_backup_nowait.test

raw
1 source include/have_ndb.inc;
2 source suite/ndb/include/backup_restore_setup.inc;
3
4 --echo # Restart Node 2 to force Node 1 to be master
5 --exec $NDB_MGM -e "2 restart -n"
6 --exec $NDB_WAITER --nowait-nodes=1 --not-started >> $NDB_TOOLS_OUTPUT
7 --exec $NDB_MGM -e "2 start"
8 --exec $NDB_WAITER >> $NDB_TOOLS_OUTPUT
9
10 --echo # Cluster running after restart node 2
11 --echo # (Node 1 is the master node)
12 --source ndb_mgm_show_table.inc
13
14 # Keep base line of number of Backup Records in use when no backup is running
15 let $base_backup_records_in_use =
16 `SELECT SUM(used) from ndbinfo.ndb\\\$pools
17 WHERE block_number=244 AND pool_name = "Backup Record"`;
18
19 # Load current backup id into "the_backup_id" variable
20 --source include/ndb_backup_id.inc
21 --let $old_backup_id = $the_backup_id
22
23 --echo # Start backup with NOWAIT option
24 --exec $NDB_MGM -e "start backup nowait" >> $NDB_TOOLS_OUTPUT
25
26 # Load current backup id into "the_backup_id" variable
27 --source include/ndb_backup_id.inc
28
29 --assert($the_backup_id > $old_backup_id)
30
31 --echo # Repeat above steps with node 2 as master
32 --echo # Restart Node 1 to force Node 2 to be master
33 --exec $NDB_MGM -e "1 restart -n"
34 --exec $NDB_WAITER --nowait-nodes=2 --not-started >> $NDB_TOOLS_OUTPUT
35 --exec $NDB_MGM -e "1 start"
36 --exec $NDB_WAITER >> $NDB_TOOLS_OUTPUT
37
38 --echo # Cluster running after restart node 1
39 --echo # (Node 2 is the master node)
40 --source ndb_mgm_show_table.inc
41
42 let $start_backup_records_in_use = $base_backup_records_in_use;
43 --source ndb_backup_nowait_wait.inc
44
45 # Load current backup id into "the_backup_id" variable
46 --source include/ndb_backup_id.inc
47 --let $old_backup_id = $the_backup_id
48
49 --echo # Start backup with NOWAIT option
50 --exec $NDB_MGM -e "start backup nowait" >> $NDB_TOOLS_OUTPUT
51
52 # Load current backup id into "the_backup_id" variable
53 --source include/ndb_backup_id.inc
54
55 --assert($the_backup_id > $old_backup_id)
56
57 let $start_backup_records_in_use = $base_backup_records_in_use;
58 --source ndb_backup_nowait_wait.inc
59
60 --source suite/ndb/include/backup_restore_cleanup.inc
61 --remove_file $NDB_TOOLS_OUTPUT