Description:
Put a breakpoint in translog_write_record(), and run
create table t(a int) engine=maria;
insert into t values(2);
Then you will see that client gets OK before gdb enters translog_write_record() for the COMMIT record, this breaks ACID. In other words, gdb first stops at:
Breakpoint 2, net_send_ok (thd=0x9181130, server_status=2, total_warn_count=0,
affected_rows=1, id=0, message=0x9181ece "") at protocol.cc:127
127 NET *net= &thd->net;
(gdb) bt
#0 net_send_ok (thd=0x9181130, server_status=2, total_warn_count=0,
affected_rows=1, id=0, message=0x9181ece "") at protocol.cc:127
#1 0x0822c541 in net_end_statement (thd=0x9181130) at protocol.cc:411
#2 0x0824e211 in dispatch_command (command=COM_QUERY, thd=0x9181130,
packet=0x91a83a9 "insert into t values(2)", packet_length=23)
at sql_parse.cc:1499
#3 0x0824e692 in do_command (thd=0x9181130) at sql_parse.cc:789
#4 0x0823dd99 in handle_one_connection (arg=0x9181130) at sql_connect.cc:1115
#5 0xb7ecc112 in start_thread () from /lib/libpthread.so.0
#6 0xb7dd12ee in clone () from /lib/libc.so.6
which is a function which sends the OK, so when leaving the function the client prints
Query OK, 1 row affected (1 min 33.66 sec)
and then gdb comes to:
Breakpoint 1, translog_write_record (lsn=0xb69b8aa0, type=LOGREC_COMMIT,
trn=0x91ba658, tbl_info=0x0, rec_len=0, part_no=2, parts_data=0xb69b8a90,
store_share_id=0x0, hook_arg=0x0) at ma_loghandler.c:6035
6035 uint short_trid= trn->short_id;
Current language: auto; currently c
(gdb) bt
#0 translog_write_record (lsn=0xb69b8aa0, type=LOGREC_COMMIT, trn=0x91ba658,
tbl_info=0x0, rec_len=0, part_no=2, parts_data=0xb69b8a90,
store_share_id=0x0, hook_arg=0x0) at ma_loghandler.c:6035
#1 0x0856c737 in ma_commit (trn=0x91ba658) at ma_commit.c:60
#2 0x0850ac1a in ha_maria::external_lock (this=0x91b9d38, thd=0x9181130,
lock_type=2) at ha_maria.cc:2337
#3 0x083289c1 in handler::ha_external_lock (this=0x91b9d38, thd=0x9181130,
lock_type=2) at handler.cc:4483
#4 0x0822e10e in unlock_external (thd=0x9181130, table=<value optimized out>,
count=1) at lock.cc:786
#5 0x0822e312 in mysql_unlock_tables (thd=0x9181130, sql_lock=0x91b9398)
at lock.cc:389
#6 0x0827f393 in close_thread_tables (thd=0x9181130) at sql_base.cc:1391
#7 0x0824e22b in dispatch_command (command=COM_QUERY, thd=0x9181130,
packet=0x91a83a9 "", packet_length=23) at sql_parse.cc:1504
#8 0x0824e692 in do_command (thd=0x9181130) at sql_parse.cc:789
Table unlocking (which is the commit in Maria) happens after sending OK...
This looks like a parent of BUG#36258.
Affects 6.0-maria too.
How to repeat:
see description.
Description: Put a breakpoint in translog_write_record(), and run create table t(a int) engine=maria; insert into t values(2); Then you will see that client gets OK before gdb enters translog_write_record() for the COMMIT record, this breaks ACID. In other words, gdb first stops at: Breakpoint 2, net_send_ok (thd=0x9181130, server_status=2, total_warn_count=0, affected_rows=1, id=0, message=0x9181ece "") at protocol.cc:127 127 NET *net= &thd->net; (gdb) bt #0 net_send_ok (thd=0x9181130, server_status=2, total_warn_count=0, affected_rows=1, id=0, message=0x9181ece "") at protocol.cc:127 #1 0x0822c541 in net_end_statement (thd=0x9181130) at protocol.cc:411 #2 0x0824e211 in dispatch_command (command=COM_QUERY, thd=0x9181130, packet=0x91a83a9 "insert into t values(2)", packet_length=23) at sql_parse.cc:1499 #3 0x0824e692 in do_command (thd=0x9181130) at sql_parse.cc:789 #4 0x0823dd99 in handle_one_connection (arg=0x9181130) at sql_connect.cc:1115 #5 0xb7ecc112 in start_thread () from /lib/libpthread.so.0 #6 0xb7dd12ee in clone () from /lib/libc.so.6 which is a function which sends the OK, so when leaving the function the client prints Query OK, 1 row affected (1 min 33.66 sec) and then gdb comes to: Breakpoint 1, translog_write_record (lsn=0xb69b8aa0, type=LOGREC_COMMIT, trn=0x91ba658, tbl_info=0x0, rec_len=0, part_no=2, parts_data=0xb69b8a90, store_share_id=0x0, hook_arg=0x0) at ma_loghandler.c:6035 6035 uint short_trid= trn->short_id; Current language: auto; currently c (gdb) bt #0 translog_write_record (lsn=0xb69b8aa0, type=LOGREC_COMMIT, trn=0x91ba658, tbl_info=0x0, rec_len=0, part_no=2, parts_data=0xb69b8a90, store_share_id=0x0, hook_arg=0x0) at ma_loghandler.c:6035 #1 0x0856c737 in ma_commit (trn=0x91ba658) at ma_commit.c:60 #2 0x0850ac1a in ha_maria::external_lock (this=0x91b9d38, thd=0x9181130, lock_type=2) at ha_maria.cc:2337 #3 0x083289c1 in handler::ha_external_lock (this=0x91b9d38, thd=0x9181130, lock_type=2) at handler.cc:4483 #4 0x0822e10e in unlock_external (thd=0x9181130, table=<value optimized out>, count=1) at lock.cc:786 #5 0x0822e312 in mysql_unlock_tables (thd=0x9181130, sql_lock=0x91b9398) at lock.cc:389 #6 0x0827f393 in close_thread_tables (thd=0x9181130) at sql_base.cc:1391 #7 0x0824e22b in dispatch_command (command=COM_QUERY, thd=0x9181130, packet=0x91a83a9 "", packet_length=23) at sql_parse.cc:1504 #8 0x0824e692 in do_command (thd=0x9181130) at sql_parse.cc:789 Table unlocking (which is the commit in Maria) happens after sending OK... This looks like a parent of BUG#36258. Affects 6.0-maria too. How to repeat: see description.