|
1 | 1 | # ==== Purpose ====
|
2 | 2 | #
|
3 |
| -# Bug #20592961 'FLUSH LOGS' POST FAULT INJECTION HITS ASSERT `! IS_SET()' AT SQL_ERROR.CC:381 |
| 3 | +# Verify that 'FLUSH LOGS' does not cause assertion failure any more, |
| 4 | +# even if there is no binlog file before executing it. |
4 | 5 | #
|
5 |
| -# If we inject some fault in binary index file using debug options, |
6 |
| -# then 'flush logs' command will hit the assertion failure |
7 |
| -# '! is_set()' at sql_error.cc:381. The root cause is that the |
8 |
| -# 'flush logs' command missed to handle an 'Bad file descriptor' |
9 |
| -# error while flushing io cache. |
| 6 | +# ==== Implementation ==== |
10 | 7 | #
|
11 |
| -# To fix the problem, handle the 'Bad file descriptor' error |
12 |
| -# while flushing io cache in the case. |
13 |
| -# |
14 |
| -# Steps to reproduce: |
15 | 8 | # 1) SET GLOBAL debug='d,error_unique_log_filename' to
|
16 |
| -# cause 'FLUSH LOGS' error and 'RESET MASTER' error. |
17 |
| -# 2) Execute 'FLUSH LOGS' to cause crash. |
18 |
| -# 3) Restart and reset the server. |
| 9 | +# cause 'FLUSH LOGS' and 'RESET MASTER' commands to error out. |
| 10 | +# 2) Execute 'FLUSH LOGS' to verify that it does not cause |
| 11 | +# assertion failure any more. |
| 12 | +# |
| 13 | +# ==== References ==== |
19 | 14 | #
|
| 15 | +# Bug#20592961: 'FLUSH LOGS' POST FAULT INJECTION HITS ASSERT `! IS_SET()' AT SQL_ERROR.CC:381 |
| 16 | +# Bug#29201665: ASAN MEMORY LEAK IN LOG_EVENT::WRITE_HEADER() IN MYSQL-5.7 |
20 | 17 |
|
21 | 18 | # Test in this file is binlog format agnostic, thus no need
|
22 | 19 | # to rerun them for every format.
|
23 | 20 | --source include/have_binlog_format_row.inc
|
24 | 21 | --source include/have_debug.inc
|
25 |
| -# Do not run the test with valgrind, since the |
26 |
| -# server may intentionally crash in the test. |
27 |
| ---source include/not_valgrind.inc |
28 | 22 |
|
29 | 23 | --disable_query_log
|
30 | 24 | call mtr.add_suppression("Can't generate a unique log-filename");
|
31 |
| -call mtr.add_suppression("The server was unable to create a new log file. An incident event has been written to the binary log which will stop the slaves."); |
32 | 25 | call mtr.add_suppression("MYSQL_BIN_LOG::open failed to generate new file name.");
|
33 | 26 | call mtr.add_suppression("Failed to locate old binlog or relay log files");
|
34 |
| -call mtr.add_suppression('Attempting backtrace'); |
35 |
| -call mtr.add_suppression("Either disk is full or file system is read only"); |
36 | 27 | call mtr.add_suppression('Could not open .*');
|
37 | 28 | --enable_query_log
|
38 | 29 | SET GLOBAL binlog_error_action= IGNORE_ERROR;
|
39 |
| -SET GLOBAL debug='+d,error_unique_log_filename'; |
| 30 | +--let $debug_point= error_unique_log_filename |
| 31 | +--source include/add_debug_point.inc |
40 | 32 |
|
41 | 33 | --error ER_NO_UNIQUE_LOGFILE
|
42 | 34 | FLUSH LOGS;
|
43 | 35 |
|
44 | 36 | # Restart the server to enable binary log.
|
45 | 37 | --source include/restart_mysqld.inc
|
46 | 38 | SET GLOBAL binlog_error_action= IGNORE_ERROR;
|
47 |
| -SET GLOBAL debug='+d,error_unique_log_filename'; |
| 39 | +--source include/add_debug_point.inc |
48 | 40 |
|
49 | 41 | --error ER_NO_UNIQUE_LOGFILE
|
50 | 42 | RESET MASTER;
|
51 | 43 |
|
52 |
| -SET GLOBAL debug='-d,error_unique_log_filename'; |
53 |
| -SET @@GLOBAL.DEBUG= @debug_save; |
| 44 | +--source include/remove_debug_point.inc |
54 | 45 |
|
55 | 46 | --error ER_UNKNOWN_TARGET_BINLOG
|
56 | 47 | RESET MASTER;
|
57 | 48 | SET GLOBAL binlog_error_action= ABORT_SERVER;
|
58 | 49 |
|
59 |
| ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
60 |
| - |
61 |
| -# The following query may cause ER_BINLOG_LOGGING_IMPOSSIBLE error, |
62 |
| -# lost connection to MySQL server or succeed. And it does not cause |
63 |
| -# assertion failure any more. |
64 |
| ---error 0,ER_BINLOG_LOGGING_IMPOSSIBLE,2013 |
| 50 | +# Verify that 'FLUSH LOGS' does not cause assertion failure any more, |
| 51 | +# even if there is no binlog before executing it. |
65 | 52 | FLUSH LOGS;
|
66 |
| - |
67 |
| -# Restart and reset the server |
68 |
| ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
69 |
| ---enable_reconnect |
70 |
| ---source include/wait_until_connected_again.inc |
71 |
| ---disable_reconnect |
72 |
| -RESET MASTER; |
0 commit comments