File: binlog_reset_master_delete_file_failure.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (104 lines) | stat: -rw-r--r-- 3,619 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
##############################################################################
# ==== Purpose ====
# The purpose of this test is to verify that appropriate error message is
# logged when RESET MASTER fails to delete binary log file.
#
# ==== Requirement ====
# R1. During RESET MASTER, if there are any failures in binary log file
#     deletion, an appropriate error message should be logged.
# R2. During RESET MASTER, if there are any failures in binary log index file
#     deletion, an appropriate error message should be logged.
#
# ==== Implementation ====
# 0. Add suppressions for the test and backup data directory
# 1. Case1: Remove binary log file and create directory with same name as
#           binlog file name
#    1.1 Save current binlog file name
#    1.2 Generate new binlog
#    1.3 Create a directory with same name as binlog file name
#    1.4 Verify that RESET MASTER failed with error
#    1.5 Clean up
# 2. Case2: Remove index file and create directory with same name as index
#           file name
#    2.1 Create a directory with same name as binlog file name
#    2.2 verify that reset master failed with error
#    2.3 Clean up
#
# ==== References ====
# BUG#33468781: void THD::send_statement_status(): Assertion `0' failed
###############################################################################

--source include/have_binlog_format_row.inc

--echo #
--echo # 0. Add suppressions for the test and backup data directory
call mtr.add_suppression("Failed to delete file.*");
RESET MASTER;
--let $MYSQLD_DATADIR= `SELECT @@datadir`
--let $BACKUP_DATADIR = $MYSQL_TMP_DIR/data_new
--force-cpdir $MYSQLD_DATADIR $BACKUP_DATADIR

--echo #
--echo # 1. Case1: Remove binary log file and create directory with same name
--echo #           as binlog file name
--echo #
--echo # 1.1. Save current binlog file name
--source include/save_binlog_position.inc
--let $first_binlog_file= $binlog_file

--echo #
--echo # 1.2 Generate new binlog
FLUSH BINARY LOGS;

--echo #
--echo # 1.3 Create a directory with same name as binlog file name
--move_file $MYSQLD_DATADIR/$first_binlog_file $MYSQLD_DATADIR/$first_binlog_file.orig
--mkdir $MYSQLD_DATADIR/$first_binlog_file

--echo #
--echo # 1.4 Verify that RESET MASTER failed with error
--error ER_BINLOG_PURGE_FATAL_ERR
RESET MASTER;

--echo #
--echo # 1.5 Clean up
# Stop the server
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
# Undo data directory changes
--force-rmdir $MYSQLD_DATADIR
--force-cpdir $BACKUP_DATADIR $MYSQLD_DATADIR
# Restart the server
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect
-- source include/wait_until_connected_again.inc

--echo #
--echo # 2. Case2: Remove index file and create directory with same name as
--echo #           index file name
--echo #
--echo # 2.1 Create a directory with same name as index file name
--let $index_file= `SELECT @@global.log_bin_index`
--move_file $index_file $index_file.orig
--mkdir $index_file

--echo #
--echo # 2.2 Verify that RESET MASTER failed with error
--error ER_BINLOG_PURGE_FATAL_ERR
RESET MASTER;

--echo #
--echo # 2.3 Cleanup
# Stop the server
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
# Undo data directory changes
--force-rmdir $MYSQLD_DATADIR
--force-cpdir $BACKUP_DATADIR $MYSQLD_DATADIR
--force-rmdir $BACKUP_DATADIR
# Restart the server
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect
-- source include/wait_until_connected_again.inc