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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
|
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
call mtr.add_suppression('Could not open .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
RESET MASTER;
flush logs;
flush logs;
flush logs;
show binary logs;
Log_name File_size Encrypted
binlog.000001 # #
binlog.000002 # #
binlog.000003 # #
binlog.000004 # #
# Create a dedicated user to demonstrate the BINLOG_ADMIN privilege
CREATE USER binlog_admin@localhost IDENTIFIED BY 'foo';
GRANT BINLOG_ADMIN ON *.* TO binlog_admin@localhost;
purge binary logs TO 'binlog.000004';
Warnings:
Warning 1612 Being purged log binlog.000001 was not found
REVOKE binlog_admin ON *.* FROM binlog_admin@localhost;
purge binary logs TO 'binlog.000004';
ERROR 42000: Access denied; you need (at least one of) the SUPER or BINLOG_ADMIN privilege(s) for this operation
DROP USER binlog_admin@localhost;
*** must show a list starting from the 'TO' argument of PURGE ***
show binary logs;
Log_name File_size Encrypted
binlog.000004 # #
reset master;
flush logs;
flush logs;
flush logs;
*** must be a warning binlog.000001 was not found ***
Warnings:
Warning 1868 file binlog.000004 was not purged because it is the active log file.
Warning 1612 Being purged log binlog.000001 was not found
*** must show one record, of the active binlog, left in the index file after PURGE ***
show binary logs;
Log_name File_size Encrypted
binlog.000004 # #
reset master;
flush logs;
flush logs;
flush logs;
purge binary logs TO 'binlog.000002';
ERROR HY000: Fatal error during log purge
show warnings;
Level Code Message
Warning 1377 a problem with deleting binlog.000001; consider examining correspondence of your binlog index file to the actual binlog files
Error 1377 Fatal error during log purge
reset master;
# crash_purge_before_update_index
flush logs;
SET SESSION debug="+d,crash_purge_before_update_index";
purge binary logs TO 'binlog.000002';
ERROR HY000: Lost connection to MySQL server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000001
binlog.000002
binlog.000003
# crash_purge_non_critical_after_update_index
flush logs;
SET SESSION debug="+d,crash_purge_non_critical_after_update_index";
purge binary logs TO 'binlog.000004';
ERROR HY000: Lost connection to MySQL server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000004
binlog.000005
# crash_purge_critical_after_update_index
flush logs;
SET SESSION debug="+d,crash_purge_critical_after_update_index";
purge binary logs TO 'binlog.000006';
ERROR HY000: Lost connection to MySQL server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
# crash_create_non_critical_before_update_index
SET SESSION debug="+d,crash_create_non_critical_before_update_index";
flush logs;
ERROR HY000: Lost connection to MySQL server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
# crash_create_critical_before_update_index
SET SESSION debug="+d,crash_create_critical_before_update_index";
flush logs;
ERROR HY000: Lost connection to MySQL server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
# crash_create_after_update_index
SET SESSION debug="+d,crash_create_after_update_index";
flush logs;
ERROR HY000: Lost connection to MySQL server during query
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
binlog.000010
binlog.000011
#
# This should put the server in unsafe state and stop
# accepting any command. If we inject a fault at this
# point and continue the execution the server crashes.
#
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
binlog.000010
binlog.000011
# fault_injection_registering_index
SET SESSION debug="+d,fault_injection_registering_index";
SET GLOBAL binlog_error_action= IGNORE_ERROR;
flush logs;
ERROR HY000: Can't open file: 'binlog.000012' (errno: 1 - Operation not permitted)
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
binlog.000010
binlog.000011
# restart
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
binlog.000010
binlog.000011
binlog.000012
# fault_injection_updating_index
SET SESSION debug="+d,fault_injection_updating_index";
SET GLOBAL binlog_error_action= IGNORE_ERROR;
flush logs;
ERROR HY000: Can't open file: 'binlog.000013' (errno: 1 - Operation not permitted)
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
binlog.000010
binlog.000011
binlog.000012
# restart
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//binlog.index');
SELECT @index;
@index
binlog.000006
binlog.000007
binlog.000008
binlog.000009
binlog.000010
binlog.000011
binlog.000012
binlog.000013
# Test case6: Set DEBUG POINT before rename index file when
# appending a binlog file name to index file.
show binary logs;
Log_name File_size Encrypted
binlog.000006 # #
binlog.000007 # #
binlog.000008 # #
binlog.000009 # #
binlog.000010 # #
binlog.000011 # #
binlog.000012 # #
binlog.000013 # #
SET SESSION debug="+d,crash_create_before_rename_index_file";
flush logs;
ERROR HY000: Lost connection to MySQL server during query
# Restart the master server
# Test if the index file has the correct data,
# i.e. binlog file name is added.
show binary logs;
Log_name File_size Encrypted
binlog.000006 # #
binlog.000007 # #
binlog.000008 # #
binlog.000009 # #
binlog.000010 # #
binlog.000011 # #
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
# Test case7: Set DEBUG POINT after rename index file when
# appending a binlog file name to index file.
SET SESSION debug="+d,crash_create_after_rename_index_file";
flush logs;
ERROR HY000: Lost connection to MySQL server during query
# Restart the master server
# Test if the index file has the correct data,
# i.e. binlog file name is added.
show binary logs;
Log_name File_size Encrypted
binlog.000006 # #
binlog.000007 # #
binlog.000008 # #
binlog.000009 # #
binlog.000010 # #
binlog.000011 # #
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
# Test case8: Set DEBUG POINT after rename index file when
# purging the index file.
show binary logs;
Log_name File_size Encrypted
binlog.000006 # #
binlog.000007 # #
binlog.000008 # #
binlog.000009 # #
binlog.000010 # #
binlog.000011 # #
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
SET SESSION debug="+d,crash_create_after_rename_index_file";
purge binary logs TO 'binlog.000010';
ERROR HY000: Lost connection to MySQL server during query
# Restart the master server
# Test if the index file has the correct data,
# i.e. requested binlog file names are removed.
show binary logs;
Log_name File_size Encrypted
binlog.000010 # #
binlog.000011 # #
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
# Test case9: Set DEBUG POINT befor rename index file when
# purging the index file.
show binary logs;
Log_name File_size Encrypted
binlog.000010 # #
binlog.000011 # #
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
SET SESSION debug="+d,crash_create_before_rename_index_file";
purge binary logs TO 'binlog.000012';
ERROR HY000: Lost connection to MySQL server during query
# Restart the master server
# Test if the index file has the correct data,
# i.e. requested binlog file names are removed.
show binary logs;
Log_name File_size Encrypted
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
binlog.000019 # #
# Test case10: Inject a fault to copy part content to the temp file
# when purging the index file.
show binary logs;
Log_name File_size Encrypted
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
binlog.000019 # #
SET SESSION debug="+d,fault_injection_copy_part_file";
purge binary logs TO 'binlog.000014';
ERROR HY000: Lost connection to MySQL server during query
# Restart the master server
# Test the index file is complete, although is not purged successfully.
show binary logs;
Log_name File_size Encrypted
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
binlog.000019 # #
binlog.000020 # #
# Test case11: Bug #20381055SERVER CRASHES IF INDEX FILE IS OPENED BY
SET SESSION debug="d,force_index_file_delete_failure";
call mtr.add_suppression("Failed to delete the existing index file");
call mtr.add_suppression("failed to move crash safe index file to index file");
call mtr.add_suppression("failed to update the index file");
PURGE BINARY LOGS TO 'binlog.000014';;
ERROR HY000: I/O error reading log index file
# Test the index file is complete, although is not purged successfully.
# Also this will indicate that binary logging is not disabled.
show binary logs;
Log_name File_size Encrypted
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
binlog.000019 # #
binlog.000020 # #
SET GLOBAL binlog_error_action='IGNORE_ERROR';
FLUSH LOGS;
ERROR HY000: Can't open file: 'binlog.000021' (errno: 1 - Operation not permitted)
SHOW BINARY LOGS;
ERROR HY000: You are not using binary logging
# restart
show binary logs;
Log_name File_size Encrypted
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
binlog.000019 # #
binlog.000020 # #
binlog.000021 # #
CREATE TABLE t1(i INT);
SET GLOBAL binlog_error_action='IGNORE_ERROR';
SET SESSION debug="+d,force_index_file_delete_failure";
SET SESSION debug="+d,force_rotate";
INSERT INTO t1 VALUES (12);
ERROR HY000: Can't open file: 'binlog.000022' (errno: 1 - Operation not permitted)
SHOW BINARY LOGS;
ERROR HY000: You are not using binary logging
# restart
show binary logs;
Log_name File_size Encrypted
binlog.000012 # #
binlog.000013 # #
binlog.000014 # #
binlog.000015 # #
binlog.000016 # #
binlog.000017 # #
binlog.000018 # #
binlog.000019 # #
binlog.000020 # #
binlog.000021 # #
binlog.000022 # #
DROP TABLE t1;
SET SESSION debug="";
# Test case11: Ends
# Test case12: Bug#25839610 ABORT OCCUR DURING SLAVE BACKUP
# WHEN RELAY LOG INDEX IS LOCK
# This test verifies that serveral retries are performed
# if there is a failure while deleting/renaming index files.
SET SESSION debug="+d,simulate_index_file_delete_failure";
SET SESSION debug="+d,simulate_crash_safe_index_file_rename_failure";
FLUSH LOGS;
include/assert_grep.inc [Retried for delete.]
include/assert_grep.inc [Retried for rename.]
SET SESSION debug="";
# Test case12: Ends
SET GLOBAL binlog_error_action= ABORT_SERVER;
RESET MASTER;
End of tests
|