[MDEV-29533] Crash when MariaDB is replica of MySQL 8.0 Created: 2022-09-14  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: MG Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File core.tar.gz    
Issue Links:
Relates
relates to MDEV-28906 MySQL 8.0 desired compatibility Open
relates to MDEV-29532 Connect engine crash with MySQL 8 Open

 Description   

Configure MySQL to use non-default settings:

character_set_server = 'utf8mb4'
collation_server='utf8mb4_unicode_520_ci'
character_set_client_handshake=0
binlog_checksum=0

Configure MariaDB with skip-slave-start

Connect to MySQL:

MariaDB [(none)]> system truncate -s0 /var/lib/mysql/mg.err
MariaDB [(none)]> set global replicate_wild_do_table='test.%';
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> change master to master_host='mysql8', master_user='replica', master_password='SDfkhskj53!';
Query OK, 0 rows affected (0.008 sec)
 
MariaDB [(none)]> start slave io_thread;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [(none)]> stop slave;
ERROR 2013 (HY000): Lost connection to server during query

2022-09-14  5:09:20 4 [Note] Slave I/O thread: Start asynchronous replication to master 'replica@mysql8:3306' in log '' at position 4
2022-09-14  5:09:20 4 [ERROR] Slave I/O: error connecting to master 'replica@mysql8:3306' - retry-time: 60  maximum-retries: 100000  message: Access denied for user 'replica'@'104.130.132.75' (using password: YES), Internal MariaDB error code: 1045
2022-09-14  5:09:27 4 [Note] Slave I/O thread killed while connecting to master
2022-09-14  5:09:27 4 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4, master mysql8:3306
220914  5:09:27 [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 https://mariadb.com/kb/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.7.5-MariaDB-log
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467995 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7fe11c0009b8
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 = 0x7fe15869aa70 thread_stack 0x49000
/usr/sbin/mariadbd(my_print_stacktrace+0x2e)[0x5574175f047e]
/usr/sbin/mariadbd(handle_fatal_signal+0x307)[0x55741705edf7]
sigaction.c:0(__restore_rt)[0x7fe17235b630]
/usr/sbin/mariadbd(+0x9ea8f7)[0x5574170318f7]
/usr/sbin/mariadbd(mysql_close+0x22)[0x557417034eb2]
/usr/sbin/mariadbd(handle_slave_io+0x887)[0x557416d7e857]
/usr/sbin/mariadbd(+0xc3b8ac)[0x5574172828ac]
nptl/pthread_create.c:307(start_thread)[0x7fe172353ea5]
x86_64/clone.S:113(__clone)[0x7fe17186eb0d]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): (null)
Connection ID (thread ID): 4
Status: NOT_KILLED



 Comments   
Comment by Angelique Sklavounos (Inactive) [ 2022-09-14 ]

Thank you for the report, mg. I can reproduce this. For now I will gather more information about the behavior.

Comment by Angelique Sklavounos (Inactive) [ 2022-09-15 ]

I've attached a core dump for the crash.

I did a standard install of MySQL 8.0.30, then started the client as root and ran the following:

create user 'r1'@'%' identified by 'password';
grant replication slave on *.* to 'r1'@'%';

I found that the non-default settings in the MySQL my.cnf in the description were not necessary to recreate the crash.

In MariaDB 10.7.5, only the following is needed for the crash:

change master to master_host='mysql8', master_user='r1', master_password='password';
start slave io_thread;
stop slave;

I still need to test against other versions of MariaDB.

Comment by MG [ 2022-09-15 ]

Thanks for looking at this, @angelique.sklavounos

In my earlier testing of 10.4 and 10.6, I would not get a crash before the MySQL my.cnf changes:

MariaDB [(none)]> SET @@session.character_set_client=255,@@session.collation_connection=255,@@session.collation_server=255/*!*/;
ERROR 1115 (42000): Unknown character set: '255'

Comment by Angelique Sklavounos (Inactive) [ 2022-09-27 ]

In my earlier testing of 10.4 and 10.6, I would not get a crash before the MySQL my.cnf changes:

mg which version of 10.4 and 10.6 did you use? I tested with 10.6.9 and still get a crash.

Comment by MG [ 2022-09-27 ]

Hello,

My apologies, the original error ERROR 1273 (HY000) at line 18259: Unknown collation was on an ancient 10.4.6

With 10.4.26 I get the crash with MySQL 8 defaults as long as any % grant exists:

[root@maria ~]# yum install MariaDB-server-10.4.26-1.el7.centos
[root@maria ~]# systemctl start mariadb
[root@maria ~]# mysql -e 'change master to master_host="mysql8", master_user="random", master_password="anything"'
[root@maria ~]# mysql -e 'start slave'
[root@maria ~]# mysql -e 'stop slave'
ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query

Comment by MG [ 2022-09-27 ]

Hello,

Actually I can't reproduce Unknown collation on my own 10.4.6 but (I see the same crash as my last comment) but on a MySQL 8 instance (Ali) that I don't have access to that is the error I get.

Sorry, I can't provide more at this time.

Comment by Angelique Sklavounos (Inactive) [ 2022-09-27 ]

Great, thanks for the clarification, mg.

Generated at Thu Feb 08 10:09:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.