# Store this file at some slave server dir, e.g in the current one. # Launch this script as # gdb --batch -ex "attach $(cat /var/lib/mysql/mariadb.pid)" -x ./my_gdb.txt 2>&1 > gdb.log # few minutes before the expected OOO slave error. # By the binlog analysis we see the problem always occurs at the first alter-sequence # processing time. # The script reacts on the first ALTER-SEQUENCE replication event to # monitor its processing to close itself at its end. # Provide us back with the output in gdb.log. # watch range in terms of gtid:s starting from one that follows the first ALTER-seq # passed to commit set $range = 20 set $s0 = 4294967294 set $sno = $s0 set $waiter3 = 0 set $ra2 = 0 set $r3 = 0 set $sno_a = $s0 set pri pre on # 1 br rpl_parallel.cc:2908 if $sno == $s0 && (gtid_flags & 1) commands p gtid_flags p $sno = rgi->current_gtid.seq_no + 1 p $ra2 = rgi p $sno_a = rgi->current_gtid.seq_no dis 1 cont end # 2 br rpl_parallel.cc:2918 if rgi->current_gtid.seq_no == $sno commands p $r3 = rgi p $waiter3 = & $r3->commit_orderer p $r3->wait_commit_group_info == $ra2 if (gtid_flags & 1) == 0 dis 2 end cont end # T1 or T3 commit incl skip br rpl_gtid.cc:1594 if strict && elem->last_gtid->seq_no >= $sno-5 commands p gtid->seq_no if elem->last_gtid->seq_no + 1 < gtid->seq_no print "unexpected skip" p elem->domain_id p * elem->last_gtid if ($ra2) p * $ra2 end if ($r3) p * $r3 end thr app all bt detach end if $sno < gtid->seq_no - $range p $sno p *gtid detach end cont end br sql_class.cc:8172 if handle_rpl_parallel_thread::thd->rgi_slave->current_gtid.seq_no >= $sno_a commands p handle_rpl_parallel_thread::thd->rgi_slave->current_gtid p waiter bt if waiter == $waiter3 thr app all bt # detach end cont end cont