Bug #107899 Assertion `!is_set()' with RESET REPLICA when both GR channel is configured
Submitted: 17 Jul 2022 13:27 Modified: 26 Jul 2022 8:42
Reporter: Venkatesh Prasad Venugopal (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Replication Severity:S6 (Debug Builds)
Version:8.0.29 OS:Any
Assigned to: CPU Architecture:Any

[17 Jul 2022 13:27] Venkatesh Prasad Venugopal
MySQL server hits the assertion 

   void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set()' failed

on RESET REPLICA when both GR and async channels are configured.



(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff753e859 in __GI_abort () at abort.c:79
#2  0x00007ffff753e729 in __assert_fail_base (fmt=0x7ffff76d4588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555b6f6eed "!is_set()", 
    file=0x55555b6f6d80 "/home/venki/work/mysql/80/sql/sql_error.cc", line=374, function=<optimized out>) at assert.c:92
#3  0x00007ffff754ffd6 in __GI___assert_fail (assertion=0x55555b6f6eed "!is_set()", file=0x55555b6f6d80 "/home/venki/work/mysql/80/sql/sql_error.cc", line=374, 
    function=0x55555b6f72a0 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)")
    at assert.c:101
#4  0x0000555558927811 in Diagnostics_area::set_ok_status (this=0x7fff2c003510, affected_rows=0, last_insert_id=0, message_text=0x0) at /home/venki/work/mysql/80/sql/sql_error.cc:374
#5  0x00005555588bf01c in my_ok (thd=0x7fff2c001040, affected_rows=0, id=0, message=0x0) at /home/venki/work/mysql/80/sql/sql_class.cc:3257
#6  0x00005555589a3cc1 in mysql_execute_command (thd=0x7fff2c001040, first_level=true) at /home/venki/work/mysql/80/sql/sql_parse.cc:4092
#7  0x00005555589a74d5 in dispatch_sql_command (thd=0x7fff2c001040, parser_state=0x7fffa07f6b50) at /home/venki/work/mysql/80/sql/sql_parse.cc:5207
#8  0x000055555899d1b8 in dispatch_command (thd=0x7fff2c001040, com_data=0x7fffa07f7b40, command=COM_QUERY) at /home/venki/work/mysql/80/sql/sql_parse.cc:1957
#9  0x000055555899b0af in do_command (thd=0x7fff2c001040) at /home/venki/work/mysql/80/sql/sql_parse.cc:1352
#10 0x0000555558ba7d6b in handle_connection (arg=0x5555602154b0) at /home/venki/work/mysql/80/sql/conn_handler/connection_handler_per_thread.cc:302
#11 0x000055555aaa7d08 in pfs_spawn_thread (arg=0x55556028f1d0) at /home/venki/work/mysql/80/storage/perfschema/pfs.cc:2942
#12 0x00007ffff7f85609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#13 0x00007ffff763b133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

However, this is not a problem in release builds as RESET REPLICA will error out as is expected.

  mysql> reset replica;
  ERROR 3081 (HY000): This operation cannot be performed with running replication threads; run STOP SLAVE FOR CHANNEL '' first

How to repeat:
Steps to reproduce:

1) Start a single node cluster

  1. INSTALL PLUGIN  group_replication SONAME 'group_replication.so';
  2. SET GLOBAL group_replication_group_name='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa';
  3. SET GLOBAL group_replication_group_seeds = "localhost:5555";
  4. SET GLOBAL group_replication_local_address= 'localhost:5555';
  5. SET GLOBAL group_replication_bootstrap_group=ON;
  7. SET GLOBAL group_replication_bootstrap_group=OFF;

2)Setup async replication to non-existent server

  8. CHANGE MASTER TO master_host='',master_port=13001,master_user='root'; -- 13001 is not running 

3) Shutdown and restart Node 1 

   9. Shutdown Node 1
  10. Restart Node 1


  ERROR 2013 (HY000): Lost connection to MySQL server during query 
  No connection. Trying to reconnect... 
  Connection id:    14 Current database: *** NONE ***ERROR 2013 (HY000): Lost connection to MySQL server during query No connection. Trying to reconnect... ERROR 2003 (HY000): 
  Can't connect to MySQL server on '' (111) 
  Can't connect to the server
[26 Jul 2022 8:42] MySQL Verification Team
Hello Venu,

Thank you for the report and feedback.