[MDEV-11094] Blackhole table updates on slave fail when row annotation is enabled Created: 2016-10-20  Updated: 2019-06-13  Resolved: 2019-05-29

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.1.18, 10.2.2
Fix Version/s: 10.2.25, 10.1.41, 10.3.16, 10.4.6

Type: Bug Priority: Major
Reporter: Nirbhay Choubey (Inactive) Assignee: Sujatha Sivakumar (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-7635 update defaults and simplify mysqld c... Closed

 Description   

How to reproduce:

$ perl mtr rpl_blackhole_bug --mysqld=--binlog_annotate_row_events=1 --mysqld=--replicate_annotate_row_events=1

Test case:

source include/master-slave.inc;
source include/have_blackhole.inc;
 
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
 
# We start with no primary key
CREATE TABLE t1 (a INT, b INT, c INT);
 
sync_slave_with_master;
ALTER TABLE t1 ENGINE=BLACKHOLE;
 
connection master;
INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4);
--disable_warnings
UPDATE t1 SET c = 2 WHERE b = 1;
--enable_warnings
 
DROP TABLE t1;
 
sync_slave_with_master;
source include/rpl_end.inc;

Output:

...
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
rpl.rpl_blackhole_bug 'mix'              [ pass ]    791
rpl.rpl_blackhole_bug 'row'              [ fail ]
        Test ended at 2016-10-20 17:09:52
...
Replicate_Wild_Ignore_Table	
Last_Errno	1032
Last_Error	Could not execute Update_rows_v1 event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000001, end_log_pos 1510
Skip_Counter	0
Exec_Master_Log_Pos	1271
...

Original test: rpl.rpl_blackhole
Note: The failure is only triggered if replicate_annotate_row_events is enables as well.



 Comments   
Comment by Elena Stepanova [ 2017-01-20 ]

Make sure that the test case is re-enabled when the bug is fixed.

Comment by Sujatha Sivakumar (Inactive) [ 2019-05-17 ]

Hello Andrei,

Can you please review the changes for MDEV-11094.

Patch is available at:-
https://github.com/MariaDB/server/commit/53d0e9217943719b806ef9fa1cac0a699df4839c

Test results are available at:-
http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.1-sujatha

Comment by Andrei Elkin [ 2019-05-22 ]

Sujatha,

It was a good analysis by you and
while your attempt to fix must be effective I still recommend to consider a simpler method
replied along with review notes.

Cheers,

Andrei

Comment by Sujatha Sivakumar (Inactive) [ 2019-05-29 ]

Fix is pushed into 10.1.41.
But in 10.2 there are changes in test script like I mentioned below.
1. rpl_blackhole.test - needs to enabled and its result file needs to be re-recorded.
2. Newly added test 'rpl_blackhole_row_annotate.test'needs to be improved as the 'mysqlbinlog' tool adds CRC 32 to its output.
I have implemented all theses and tested in bb-10.2-sujatha
https://github.com/MariaDB/server/commit/888e170960717dec970669cafa726921de1102ef

10.3 Merge:-
=======
In 10.3 /mysql-test/extra/rpl_tests directory is not available.
Hence a new file './mysql-test/extra/rpl_tests/rpl_blackhole_basic.test' added as part of fix
needs to be relocated to /mysql-test/suite/rpl/include and the tests needs to updated.
The patch is tested on bb-10.3-sujatha.
https://github.com/MariaDB/server/commit/9969eae1338da9ebf7eec7bc62c53be2efb70635

Generated at Thu Feb 08 07:47:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.