File: binlog_restart_server_with_exhausted_index_value.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 (121 lines) | stat: -rw-r--r-- 4,776 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# ==== Purpose ====
#
# Verify that the server aborts with errors regardless of the value of
# binlog_error_action while restarting it with exhausted binlog index value.
#
# ==== Implementation ====
#
# 1. Manually update the index file to make the next binary log file
#    be created with an exhausted binlog index value.
# 2. Shutdown the server.
# 3. Start the server with --binlog_error_action=IGNORE_ERROR/ABORT_SERVER.
# 4. Verify that the server aborts with errors.
# 5. Start the server after removing the binary log with exhausted index value.
# 6. Clean up.
# 7. Clean all configuration changes after running the test.
#
# ==== References ====
#
# Bug#28995220 SEGFAULT DURING SERVER START IF BINLOG INDEX VALUES ARE EXHAUSTED
# Bug#28980788 RESET MASTER TO ALLOWS INVALID INPUT WITHOUT ERROR'S, CAN LEAD
#               TO SERVER HALTS

# This test script will be run only in non GR set up.
--source include/not_group_replication_plugin.inc
--source include/not_windows.inc
--source include/not_valgrind.inc

# Test in this file is binlog format agnostic, thus no need
# to rerun it for every format.
--source include/have_binlog_format_row.inc
--source include/have_log_bin.inc

call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0. Please consider archiving some logs");
call mtr.add_suppression("Log filename extension number exhausted: 2147483647. Please fix this by archiving old logs and updating the index files.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to generate new file name.");
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out*");

--write_file $MYSQLTEST_VARDIR/tmp/binlog_restart_server_with_exhausted_index_value.inc PROCEDURE
  if ($server_params == '')
  {
    --die !!!ERROR IN TEST: you must set $server_params
  }
  if ($error_log == '')
  {
    --die !!!ERROR IN TEST: you must set $error_log
  }
  --let $mysqld=$MYSQLD_CMD --core-file --console > $error_log 2>&1 $server_params
  --error 1
  --exec $mysqld
  # The server start aborts. Count should be 1 for all the below errors.
  --let $grep_pattern=Aborting
  --let $grep_file=$error_log
  --let $grep_output=print_count
  --source include/grep_pattern.inc

  --let $grep_pattern=MYSQL_BIN_LOG::open failed to generate new file name.
  --let $grep_file=$error_log
  --let $grep_output=print_count
  --source include/grep_pattern.inc

  --let $grep_pattern=Can't generate a unique log-filename .*
  --let $grep_file=$error_log
  --let $grep_output=print_count
  --source include/grep_pattern.inc

  --let $grep_pattern=Log filename extension number exhausted: 2147483647. Please fix this by archiving old logs and updating the index files.
  --let $grep_file=$error_log
  --let $grep_output=print_count
  --source include/grep_pattern.inc
#END OF
PROCEDURE

# Clear the existing binlogs
RESET MASTER;

--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $mysqld_datadir= `SELECT @@global.datadir`
--let $index_file= `SELECT @@global.log_bin_index`

# Shutdown the server and manually update the index file to make
# the next binary log file be created with an exhausted binlog index value.
--source include/shutdown_mysqld.inc
--remove_file $index_file
--write_file $index_file
./binlog.2147483646
EOF
--move_file $mysqld_datadir/$binlog_file $mysqld_datadir/binlog.2147483646

# Restart the server
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc

--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--let $error_log= $MYSQLTEST_VARDIR/tmp/binlog_error_action.err

# Verify that FLUSH BINARY LOGS after the exhaustion of binlog index values
# causes the server to abort.
--error ER_BINLOG_LOGGING_IMPOSSIBLE
FLUSH BINARY LOGS;

--let $server_params= --binlog_error_action=IGNORE_ERROR
--source $MYSQLTEST_VARDIR/tmp/binlog_restart_server_with_exhausted_index_value.inc

--let $server_params= --binlog_error_action=ABORT_SERVER
--source $MYSQLTEST_VARDIR/tmp/binlog_restart_server_with_exhausted_index_value.inc

# Start the server after removing the binary log with exhausted index value.
--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/binlog.index
--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/binlog.2147483646
--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/binlog.2147483647
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
# Clean up.
--let $server_params=
--let $error_log=
--remove_file $MYSQLTEST_VARDIR/tmp/binlog_error_action.err
--remove_file $MYSQLTEST_VARDIR/tmp/binlog_restart_server_with_exhausted_index_value.inc

# Clean all configuration changes after running the test.
--source include/force_restart.inc