mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-11092 Assertion `!writer.checksum_len || writer.remains == 0' failed
Problem:- This crash happens because logged stmt is quite big and while writing Annotate_rows_log_event it throws EFBIG error but we ignore this error and do not call cache_data->set_incident(). Solution:- When we normally write Binlog_log_event we check for error EFBIG, but we did do this for Annotate_rows_log_event. We check for this error and call cache_data->set_incident() accordingly. # Conflicts: # sql/log.cc
This commit is contained in:
17
mysql-test/suite/rpl/r/rpl_mdev-11092.result
Normal file
17
mysql-test/suite/rpl/r/rpl_mdev-11092.result
Normal file
@@ -0,0 +1,17 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
|
||||
SET GLOBAL max_binlog_cache_size = 4096;
|
||||
SET GLOBAL binlog_cache_size = 4096;
|
||||
SET GLOBAL max_binlog_stmt_cache_size = 4096;
|
||||
SET GLOBAL binlog_stmt_cache_size = 4096;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM;
|
||||
ERROR HY000: Writing one row to the row-based binary log failed
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
|
||||
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
|
||||
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
|
||||
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
|
||||
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
|
||||
DROP TABLE t1;
|
||||
include/rpl_end.inc
|
53
mysql-test/suite/rpl/t/rpl_mdev-11092.test
Normal file
53
mysql-test/suite/rpl/t/rpl_mdev-11092.test
Normal file
@@ -0,0 +1,53 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_windows.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
########################################################################################
|
||||
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
|
||||
|
||||
let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
|
||||
let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
|
||||
let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1);
|
||||
let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1);
|
||||
|
||||
SET GLOBAL max_binlog_cache_size = 4096;
|
||||
SET GLOBAL binlog_cache_size = 4096;
|
||||
SET GLOBAL max_binlog_stmt_cache_size = 4096;
|
||||
SET GLOBAL binlog_stmt_cache_size = 4096;
|
||||
disconnect master;
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM;
|
||||
|
||||
let $data = `select concat('"', repeat('a',2000), '"')`;
|
||||
|
||||
connection master;
|
||||
|
||||
--disable_query_log
|
||||
--error ER_BINLOG_ROW_LOGGING_FAILED
|
||||
eval INSERT INTO t1 (a, data) VALUES (2,
|
||||
CONCAT($data, $data, $data, $data, $data, $data));
|
||||
--enable_query_log
|
||||
|
||||
# Incident event
|
||||
# 1590=ER_SLAVE_INCIDENT
|
||||
--let $slave_sql_errno= 1590
|
||||
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||
|
||||
connection master;
|
||||
|
||||
--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
|
||||
--replace_result $old_binlog_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
|
||||
--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
|
||||
--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
|
||||
--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--source include/rpl_end.inc
|
@@ -4887,14 +4887,21 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional,
|
||||
|
||||
IO_CACHE *file=
|
||||
cache_mngr->get_binlog_cache_log(use_trans_cache(this, is_transactional));
|
||||
binlog_cache_data *cache_data=
|
||||
cache_mngr->get_binlog_cache_data(use_trans_cache(this, is_transactional));
|
||||
|
||||
if (with_annotate && *with_annotate)
|
||||
{
|
||||
Annotate_rows_log_event anno(current_thd, is_transactional, false);
|
||||
/* Annotate event should be written not more than once */
|
||||
*with_annotate= 0;
|
||||
if ((error= anno.write(file)))
|
||||
{
|
||||
if (my_errno == EFBIG)
|
||||
cache_data->set_incident();
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
}
|
||||
if ((error= the_event.write(file)))
|
||||
DBUG_RETURN(error);
|
||||
|
||||
|
Reference in New Issue
Block a user