Debian Codegraph @

mysql-test/suite/ndb/t/ndb_backup_nowait_start.inc

raw
1 #
2 # Start backup, but dont wait for it to complete
3 # - also save the number of "Backup records" in DBLQH before start, this value
4 # is later used to wait for backup to complete in ndb_backup_nowait_wait.inc
5 #
6
7 # Save backup id before backup start
8 --source include/ndb_backup_id.inc
9 let $_pre_backup_id = $the_backup_id;
10
11 # Save backup records in BACKUP before backup start
12 let $start_backup_records_in_use =
13 `SELECT SUM(used) from ndbinfo.ndb\\\$pools
14 WHERE block_number=244 AND pool_name = "Backup Record"`;
15
16 # Print start backup message, show any extra parameters
17 let $_start_backup_msg = Starting backup;
18 if ($start_backup_extra){
19 let $_start_backup_msg = Starting $start_backup_extra backup;
20 }
21 echo $_start_backup_msg;
22
23 # Use WAIT STARTED rather than NOWAIT
24 # NOWAIT does not wait for a BACKUP_CONF in MGMD, and so does not handle e.g.
25 # the case where MGMD sends the BACKUP_REQ to the wrong Master. This could
26 # result in no backup being started, silently, resulting in test case
27 # failures
28 --let $START_BACKUP_OUTFILE=$MYSQLTEST_VARDIR/tmp/start_backup_outfile.txt
29 --exec $NDB_MGM -e "start backup $start_backup_extra wait started" >> $START_BACKUP_OUTFILE
30
31 # Make sure that backup id has increased (this is a sanity check that backup
32 # has changed state)
33 #
34 --source include/ndb_backup_id.inc
35 if ($the_backup_id <= $_pre_backup_id)
36 {
37 echo Pre backup id: $_pre_backup_id;
38 echo The backup id: $the_backup_id;
39 echo Start backup extra: "$start_backup_extra";
40 echo Start backup records: $start_backup_records_in_use;
41 echo === Dumping log from "start backup" ==;
42 cat_file $START_BACKUP_OUTFILE;
43 echo === =============================== ==;
44 die The backup id was not increased during start of backup;
45 }
46
47 --remove_file $START_BACKUP_OUTFILE
48
49 # NOTE! When using this include file without stalling the backup with an
50 # error insert it might even have completed at this point
51
52 --echo Backup started
53
54 # Reset parameters
55 let $start_backup_extra =;