It changed from NO_CONFLICT to CERT_FAILURE later in the stack:
Breakpoint 2, wsrep_run_wsrep_commit (thd=thd@entry=0x20572f0, hton=hton@entry=0x188bf30, all=all@entry=true) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/wsrep_hton.cc:271
271 {
$37 = NO_CONFLICT
#0 wsrep_run_wsrep_commit (thd=thd@entry=0x20572f0, hton=hton@entry=0x188bf30, all=all@entry=true) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/wsrep_hton.cc:271
#1 0x0000000000683258 in wsrep_prepare (hton=0x188bf30, thd=0x20572f0, all=<optimized out>) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/wsrep_hton.cc:156
#2 0x00000000006d9322 in ha_commit_trans (thd=thd@entry=0x20572f0, all=all@entry=true) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/handler.cc:1384
#3 0x000000000066a1cc in trans_commit_implicit (thd=0x20572f0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/transaction.cc:248
#4 0x000000000058806d in select_create::send_eof (this=0x7f0828005ac8) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_insert.cc:4129
#5 0x00000000005d822e in do_select (join=join@entry=0x7f082801aa10, fields=fields@entry=0x20598c0, table=table@entry=0x0, procedure=0x0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_select.cc:11663
#6 0x00000000005ec091 in JOIN::exec (this=this@entry=0x7f082801aa10) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_select.cc:2428
#7 0x00000000005e6286 in mysql_select (thd=thd@entry=0x20572f0, rref_pointer_array=rref_pointer_array@entry=0x2059998, tables=0x7f08280053d0, wild_num=1, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=select_options@entry=2416708096, result=result@entry=0x7f0828005ac8, unit=unit@entry=0x2059190, select_lex=select_lex@entry=0x20597b0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_select.cc:2647
#8 0x00000000005e64c4 in handle_select (thd=thd@entry=0x20572f0, lex=lex@entry=0x20590d0, result=result@entry=0x7f0828005ac8, setup_tables_done_option=setup_tables_done_option@entry=0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_select.cc:315
#9 0x00000000005a13b2 in mysql_execute_command (thd=thd@entry=0x20572f0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_parse.cc:3078
#10 0x00000000005a8c73 in mysql_parse (thd=thd@entry=0x20572f0, rawbuf=rawbuf@entry=0x7f0828004c10 "CREATE TABLE i AS SELECT * FROM `table1000_innodb_int_autoinc`", length=length@entry=63, parser_state=parser_state@entry=0x7f088c1415e0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_parse.cc:6527
#11 0x00000000005a98e3 in wsrep_mysql_parse (thd=thd@entry=0x20572f0, rawbuf=0x7f0828004c10 "CREATE TABLE i AS SELECT * FROM `table1000_innodb_int_autoinc`", length=63, parser_state=parser_state@entry=0x7f088c1415e0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_parse.cc:6332
#12 0x00000000005aaee6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x20572f0, packet=packet@entry=0x205a641 " CREATE TABLE i AS SELECT * FROM `table1000_innodb_int_autoinc` ", packet_length=packet_length@entry=65) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_parse.cc:1256
#13 0x00000000005ad2f4 in do_command (thd=0x20572f0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_parse.cc:885
#14 0x000000000065b2a7 in do_handle_one_connection (thd_arg=thd_arg@entry=0x20572f0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_connect.cc:1526
#15 0x000000000065b4dd in handle_one_connection (arg=0x20572f0) at /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_connect.cc:1434
#16 0x00007f08a01d70a2 in start_thread () from /usr/lib/libpthread.so.0
#17 0x00007f089ea3a43d in clone () from /usr/lib/libc.so.6
(gdb) break select_create::send_eof
Breakpoint 1 at 0x58801a: file /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/sql_insert.cc, line 4115.
(gdb) commands 1
Type commands for breakpoint(s) 1, one per line.
End with a line saying just "end".
>init-if-undefined $x = 0
>set $x = 1
>print thd->wsrep_conflict_state
>continue
>end
(gdb) break wsrep_run_wsrep_commit if $x == 1
Breakpoint 2 at 0x68157c: file /media/Tintin/Work/code/percona-xtradb-cluster/trunk/Percona-Server/sql/wsrep_hton.cc, line 271.
(gdb) commands 2
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>set $x = 0
>print thd->wsrep_conflict_state
>bt
>continue
>end
(gdb) set pagination
(gdb) set pagination off
(gdb) continue
Continuing.
It changed from NO_CONFLICT to CERT_FAILURE later in the stack:
Breakpoint 2, wsrep_run_ wsrep_commit (thd=thd@ entry=0x20572f0 , hton=hton@ entry=0x188bf30 , all=all@entry=true) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/wsrep_ hton.cc: 271 wsrep_commit (thd=thd@ entry=0x20572f0 , hton=hton@ entry=0x188bf30 , all=all@entry=true) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/wsrep_ hton.cc: 271 Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/wsrep_ hton.cc: 156 entry=0x20572f0 , all=all@entry=true) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/handler. cc:1384 implicit (thd=0x20572f0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/transaction .cc:248 create: :send_eof (this=0x7f08280 05ac8) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ insert. cc:4129 entry=0x7f08280 1aa10, fields= fields@ entry=0x20598c0 , table=table@ entry=0x0, procedure=0x0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ select. cc:11663 entry=0x7f08280 1aa10) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ select. cc:2428 entry=0x20572f0 , rref_pointer_ array=rref_ pointer_ array@entry= 0x2059998, tables= 0x7f08280053d0, wild_num=1, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_ options= select_ options@ entry=241670809 6, result= result@ entry=0x7f08280 05ac8, unit=unit@ entry=0x2059190 , select_ lex=select_ lex@entry= 0x20597b0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ select. cc:2647 entry=0x20572f0 , lex=lex@ entry=0x20590d0 , result= result@ entry=0x7f08280 05ac8, setup_tables_ done_option= setup_tables_ done_option@ entry=0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ select. cc:315 command (thd=thd@ entry=0x20572f0 ) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ parse.cc: 3078 entry=0x20572f0 , rawbuf= rawbuf@ entry=0x7f08280 04c10 "CREATE TABLE i AS SELECT * FROM `table1000_ innodb_ int_autoinc` ", length= length@ entry=63, parser_ state=parser_ state@entry= 0x7f088c1415e0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ parse.cc: 6527 entry=0x20572f0 , rawbuf= 0x7f0828004c10 "CREATE TABLE i AS SELECT * FROM `table1000_ innodb_ int_autoinc` ", length=63, parser_ state=parser_ state@entry= 0x7f088c1415e0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ parse.cc: 6332 command@ entry=COM_ QUERY, thd=thd@ entry=0x20572f0 , packet= packet@ entry=0x205a641 " CREATE TABLE i AS SELECT * FROM `table1000_ innodb_ int_autoinc` ", packet_ length= packet_ length@ entry=65) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ parse.cc: 1256 Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ parse.cc: 885 one_connection (thd_arg= thd_arg@ entry=0x20572f0 ) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ connect. cc:1526 one_connection (arg=0x20572f0) at /media/ Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ connect. cc:1434 libpthread. so.0
271 {
$37 = NO_CONFLICT
#0 wsrep_run_
#1 0x0000000000683258 in wsrep_prepare (hton=0x188bf30, thd=0x20572f0, all=<optimized out>) at /media/
#2 0x00000000006d9322 in ha_commit_trans (thd=thd@
#3 0x000000000066a1cc in trans_commit_
#4 0x000000000058806d in select_
#5 0x00000000005d822e in do_select (join=join@
#6 0x00000000005ec091 in JOIN::exec (this=this@
#7 0x00000000005e6286 in mysql_select (thd=thd@
#8 0x00000000005e64c4 in handle_select (thd=thd@
#9 0x00000000005a13b2 in mysql_execute_
#10 0x00000000005a8c73 in mysql_parse (thd=thd@
#11 0x00000000005a98e3 in wsrep_mysql_parse (thd=thd@
#12 0x00000000005aaee6 in dispatch_command (command=
#13 0x00000000005ad2f4 in do_command (thd=0x20572f0) at /media/
#14 0x000000000065b2a7 in do_handle_
#15 0x000000000065b4dd in handle_
#16 0x00007f08a01d70a2 in start_thread () from /usr/lib/
#17 0x00007f089ea3a43d in clone () from /usr/lib/libc.so.6
======= ======= ======= ======= ======= ===
wsrep_run_ wsrep_commit has this which changes it:
if (thd->wsrep_ conflict_ state == NO_CONFLICT)
thd->wsrep_ conflict_ state = CERT_FAILURE;
WSREP_ LOG_CONFLICT( NULL, thd, FALSE);
{
}
I used following gdb script for this:
(gdb) break select_ create: :send_eof Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/sql_ insert. cc, line 4115. conflict_ state wsrep_commit if $x == 1 Tintin/ Work/code/ percona- xtradb- cluster/ trunk/Percona- Server/ sql/wsrep_ hton.cc, line 271. conflict_ state
Breakpoint 1 at 0x58801a: file /media/
(gdb) commands 1
Type commands for breakpoint(s) 1, one per line.
End with a line saying just "end".
>init-if-undefined $x = 0
>set $x = 1
>print thd->wsrep_
>continue
>end
(gdb) break wsrep_run_
Breakpoint 2 at 0x68157c: file /media/
(gdb) commands 2
Type commands for breakpoint(s) 2, one per line.
End with a line saying just "end".
>set $x = 0
>print thd->wsrep_
>bt
>continue
>end
(gdb) set pagination
(gdb) set pagination off
(gdb) continue
Continuing.
======= ======= ======= ======= ======= ======= ======= ======= ===
Will attach the full trace. As that trace will show, earlier
instances of CTAS don't crash with same stacktrace.