Commit 58b54b7d authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-9044 : Binlog corruption in Galera

While refreshing the IO_CACHE, do not update its parameters (read_pos,
read_end & pos_in_file) if there is nothing left to read.
parent 428e09a7
#
# MDEV-9044 : Getting binlog corruption on my Galera cluster (10.1.8)
# making it impossible to async slave.
#
START SLAVE;
SELECT @@GLOBAL.BINLOG_CACHE_SIZE;
@@GLOBAL.BINLOG_CACHE_SIZE
8192
CREATE TABLE t1 (c1 INTEGER PRIMARY KEY, c2 VARCHAR(12000)) ENGINE=INNODB;
CREATE TABLE t2 (c1 INTEGER PRIMARY KEY) ENGINE=INNODB;
START TRANSACTION;
INSERT INTO t1 VALUES(1, REPEAT('-', 10000));
COMMIT;
INSERT INTO t2 VALUES(1);
SELECT c1, LENGTH(c2) FROM t1;
c1 LENGTH(c2)
1 10000
SELECT * FROM t2;
c1
1
SELECT c1, LENGTH(c2) FROM t1;
c1 LENGTH(c2)
1 10000
SELECT * FROM t2;
c1
1
# Cleanup
DROP TABLE t1, t2;
STOP SLAVE;
RESET SLAVE ALL;
!include ../galera_2nodes_as_master.cnf
[mysqld.1]
binlog-cache-size=8192
--echo #
--echo # MDEV-9044 : Getting binlog corruption on my Galera cluster (10.1.8)
--echo # making it impossible to async slave.
--echo #
--source include/have_innodb.inc
--source include/galera_cluster.inc
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE;
--connection node_1
SELECT @@GLOBAL.BINLOG_CACHE_SIZE;
CREATE TABLE t1 (c1 INTEGER PRIMARY KEY, c2 VARCHAR(12000)) ENGINE=INNODB;
CREATE TABLE t2 (c1 INTEGER PRIMARY KEY) ENGINE=INNODB;
START TRANSACTION;
INSERT INTO t1 VALUES(1, REPEAT('-', 10000));
COMMIT;
INSERT INTO t2 VALUES(1);
save_master_pos;
--connection node_2
SELECT c1, LENGTH(c2) FROM t1;
SELECT * FROM t2;
--connection node_3
sync_with_master;
SELECT c1, LENGTH(c2) FROM t1;
SELECT * FROM t2;
--echo # Cleanup
--connection node_1
DROP TABLE t1, t2;
save_master_pos;
--connection node_3
sync_with_master;
STOP SLAVE;
RESET SLAVE ALL;
......@@ -663,7 +663,11 @@ int _my_b_cache_read(IO_CACHE *info, uchar *Buffer, size_t Count)
info->error= (int) left_length;
DBUG_RETURN(1);
}
length=0; /* Didn't read any chars */
else
{
info->error= 0;
DBUG_RETURN(0); /* EOF */
}
}
else if ((length= mysql_file_read(info->file,info->buffer, max_length,
info->myflags)) < Count ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment