# 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 occur 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 = 30 set $s0 = 4294967294 set $sno = $s0 set $waiter3 = 0 set $ra2 = 0 set $r3 = 0 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 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 dis 2 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 # (maybe) A2 error br rpl_gtid.cc:1748 commands p elem->last_gtid->seq_no p seq_no thr app all bt detach end br rpl_gtid.cc:1587 commands p *elem->last_gtid p *gtid thr app all bt detach end cont