[MDEV-9243] Asynchronous replication between two galera clusters. Moment the slave starts- the slave machine crashes Created: 2015-12-07  Updated: 2015-12-10  Resolved: 2015-12-10

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.1.9
Fix Version/s: 10.1.9

Type: Bug Priority: Major
Reporter: trupti mali Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None
Environment:

Debian Jessie.



 Description   

Hi,
I was using 10.0 version before where in I could get this working with my same setup.

I upgraded to 10.1.9.(Well I didnt really do upgrading process on existing setup yet. But I was doing a poc of this setup before taking upgrade decision).
My setup has two galera clsuters in two diff datacenters. with 10.1.9 - those two independent galera clusters comes up nicely. I want these two galera clusters to talk to each other using master - master replicaiton.(Two way replication). Forget about two way - I am not even able to establish 1 way replicaiton. The moment - I start slave thread on one of the galera cluster's node. the node crashes - with below error

2015-12-07 6:45:53 139917150004992 [Note] Slave SQL thread initialized, starting replication in log 'mariadb-bin.000010' at position 2812, relay log './mysqld-relay-bin.000001' position: 4
2015-12-07 6:45:54 139917199308544 [Note] Slave I/O thread: connected to master 'replication_user@139.162.214.79:3306',replication started in log 'mariadb-bin.000010' at position 2812
151207 6:45:55 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 10.1.9-MariaDB-1~jessie-log
key_buffer_size=536870912
read_buffer_size=2097152
max_used_connections=1
max_threads=102
thread_count=3
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1153038 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0x7f40ab71e008
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7f4102f66bc8 thread_stack 0x48000
mysqld(my_print_stacktrace+0x2e)[0x559ef6945b6e]
mysqld(handle_fatal_signal+0x34d)[0x559ef648ad6d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0)[0x7f4102cf08d0]
mysqld(bitmap_bits_set+0x0)[0x559ef693b360]
mysqld(_Z8pack_rowP5TABLEPK9st_bitmapPhPKh+0x2f)[0x559ef655e6af]
mysqld(_ZN3THD16binlog_write_rowEP5TABLEbPKh+0x7b)[0x559ef62db80b]
mysqld(_ZN7handler12ha_write_rowEPh+0x3fd)[0x559ef6494edd]
mysqld(_ZN15rpl_slave_state11record_gtidEP3THDPK8rpl_gtidybb+0x2f9)[0x559ef6417fb9]
mysqld(_ZN15rpl_slave_state4loadEP3THDPcmbb+0x13a)[0x559ef6418f8a]
mysqld(+0x39dc69)[0x559ef628dc69]
mysqld(handle_slave_io+0xf3b)[0x559ef6295d6b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7f4102ce90a4]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f4100e9504d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): is an invalid pointer
Connection ID (thread ID): 6
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on



 Comments   
Comment by trupti mali [ 2015-12-07 ]

Hi ,
Another observation whenever I run this command - SET GLOBAL gtid_slave_pos = 'X-XXX-XXX'
then also it crashes. I think similarity here is that whenever we touch mysql tables in galera cluster its crashing.

Comment by Michael Widenius [ 2015-12-10 ]

Thanks for all the information, it helped me locate the bug quickly.
The problem was when we where recording the GTID position in the mysql.gtid_slave_pos table in a galera cluster setup, one variable was not properly initialized.

Comment by Michael Widenius [ 2015-12-10 ]

Fixed by initialize rpl_write_set properly in rpl_slave_state::record_gtid().

Bug was introduced by me in 10.1.9 as part of fixing a bug where we write more columns than needed to the binary log in row based replication.

I didn't notice this as earlier as I didn't have the galera wsrep library installed on my machine and thus the galera test was not run as part of my testing the original fix. Have now installed the library on my machine so there is less likely that things like this should happen again.

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