- rm -rf 94814/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94814 --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/94814 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/94814/log.err --log-error-verbosity=3 --server-id=1 --log-bin= --binlog-format=ROW 2>&1 & - mysql> use test Database changed mysql> CREATE TABLE `mytable` ( -> `Id` bigint(20) NOT NULL, -> `TicketId` bigint(20) DEFAULT '0', -> `AttrId` bigint(20) DEFAULT '0', -> `AttrValueId` bigint(20) DEFAULT '0', -> `Position` int(10) DEFAULT '0', -> `db_create_time` timestamp NOT NULL DEFAULT '2000-01-01 00:00:00', -> `db_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -> PRIMARY KEY (`Id`), -> UNIQUE KEY `idx_ticketid_attrid` (`TicketId`,`AttrId`), -> KEY `idx_ticketid_pos` (`TicketId`,`Position`) -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8; insert into `mytable` values (506623656,90375007,1,506623656,0,'2019-03-27 19:08:15','2019-03-27 19:08:15');Query OK, 0 rows affected (0.01 sec) mysql> mysql> insert into `mytable` values (506612498,90374047,2,506612498,1,'2019-03-27 19:04:50','2019-03-27 19:04:50'); Query OK, 1 row affected (0.00 sec) mysql> mysql> insert into `mytable` values (506623656,90375007,1,506623656,0,'2019-03-27 19:08:15','2019-03-27 19:08:15'); Query OK, 1 row affected (0.00 sec) - A A>xa start '1';delete from `mytable` where id=506612498;insert into `mytable` values (506698389,90374047,2,506698389,1,'2019-03-27 20:17:15','2019-03-27 20:17:15');xa end '1';xa prepare '1'; Query OK, 0 rows affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) - B B>set session innodb_lock_wait_timeout=5000; Query OK, 0 rows affected (0.00 sec) B>insert into `mytable` values (506698396,90375003,1,506698396,0,'2019-03-27 20:17:15','2019-03-27 20:17:15'); ^^ -C C>select * from INNODB_LOCK_WAITS\G *************************** 1. row *************************** requesting_trx_id: 1298 requested_lock_id: 1298:23:4:3 blocking_trx_id: 1293 blocking_lock_id: 1293:23:4:3 1 row in set, 1 warning (0.01 sec) C>select * from INNODB_LOCKS\G *************************** 1. row *************************** lock_id: 1298:23:4:3 lock_trx_id: 1298 lock_mode: X,GAP lock_type: RECORD lock_table: `test`.`mytable` lock_index: idx_ticketid_attrid lock_space: 23 lock_page: 4 lock_rec: 3 lock_data: 90375007, 1 *************************** 2. row *************************** lock_id: 1293:23:4:3 lock_trx_id: 1293 lock_mode: S lock_type: RECORD lock_table: `test`.`mytable` lock_index: idx_ticketid_attrid lock_space: 23 lock_page: 4 lock_rec: 3 lock_data: 90375007, 1 2 rows in set, 1 warning (0.00 sec) -A A>xa recover; +----------+--------------+--------------+------+ | formatID | gtrid_length | bqual_length | data | +----------+--------------+--------------+------+ | 1 | 1 | 0 | 1 | +----------+--------------+--------------+------+ 1 row in set (0.00 sec) A>\q Bye A>xa commit '1'; Query OK, 0 rows affected (17.41 sec) B>insert into `mytable` values (506698396,90375003,1,506698396,0,'2019-03-27 20:17:15','2019-03-27 20:17:15'); Query OK, 1 row affected (2 min 38.82 sec) - GDB Missing separate debuginfos, use: debuginfo-install glibc-2.17-78.0.1.el7.x86_64 libaio-0.3.109-12.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libstdc++-4.8.3-9.el7.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 numactl-libs-2.0.9-5.el7_1.x86_64 (gdb) b innobase_commit_by_xid Breakpoint 1 at 0xf83200: file /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/storage/innobase/handler/ha_innodb.cc, line 17225. (gdb) b transaction_cache_delete Breakpoint 2 at 0xddf19e: file /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc, line 1276. (gdb) c Continuing. [Switching to Thread 0x7f8748065700 (LWP 12928)] Breakpoint 2, transaction_cache_delete (transaction=0x7f8718015680) at /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc:1276 1276 /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc: No such file or directory. (gdb) c Continuing. [New Thread 0x7f87400b6700 (LWP 13309)] [Switching to Thread 0x7f87400b6700 (LWP 13309)] Breakpoint 1, innobase_commit_by_xid (hton=0x235a440, xid=0x7f8704005fb0) at /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/storage/innobase/handler/ha_innodb.cc:17225 17225 /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/storage/innobase/handler/ha_innodb.cc: No such file or directory. (gdb) c Continuing. Breakpoint 2, transaction_cache_delete (transaction=0x7f8718016860) at /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc:1276 1276 /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc: No such file or directory. (gdb) c Continuing. [Switching to Thread 0x7f87400f7700 (LWP 12933)] Breakpoint 2, transaction_cache_delete (transaction=0x7f87100042d0) at /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc:1276 1276 in /export/home/pb2/build/sb_0-32013917-1545390211.74/mysql-5.7.25/sql/xa.cc (gdb) c Continuing. - extract from binlog /export/umesh/server/binaries/GABuilds/mysql-5.7.25: bin/mysqlbinlog 94814/hod03-bin.000001 -v . . # at 2166 #190415 11:46:04 server id 1 end_log_pos 2231 CRC32 0x6eae60eb Anonymous_GTID last_committed=5 sequence_number=6 rbr_only=yes /*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/; SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/; # at 2231 #190415 11:46:04 server id 1 end_log_pos 2311 CRC32 0xcd5d3150 Query thread_id=4 exec_time=159 error_code=0 SET TIMESTAMP=1555321564/*!*/; BEGIN /*!*/; # at 2311 #190415 11:46:04 server id 1 end_log_pos 2369 CRC32 0x425fd8e6 Table_map: `test`.`mytable` mapped to number 108 # at 2369 #190415 11:46:04 server id 1 end_log_pos 2449 CRC32 0xe70b2c48 Write_rows: table id 108 flags: STMT_END_F BINLOG ' 3FK0XBMBAAAAOgAAAEEJAAAAAGwAAAAAAAEABHRlc3QAB215dGFibGUABwgICAgDERECAAAe5thf Qg== 3FK0XB4BAAAAUAAAAJEJAAAAAGwAAAAAAAEAAgAH/4CcmjMeAAAAAFsDYwUAAAAAAQAAAAAAAACc mjMeAAAAAAAAAABcm8w7XJvMO0gsC+c= '/*!*/; ### INSERT INTO `test`.`mytable` ### SET ### @1=506698396 ### @2=90375003 ### @3=1 ### @4=506698396 ### @5=0 ### @6=1553714235 ### @7=1553714235 # at 2449 #190415 11:46:04 server id 1 end_log_pos 2480 CRC32 0xf40f65ab Xid = 30 COMMIT/*!*/; # at 2480 #190415 11:48:38 server id 1 end_log_pos 2545 CRC32 0xd322203a Anonymous_GTID last_committed=5 sequence_number=7 rbr_only=no SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/; # at 2545 #190415 11:48:38 server id 1 end_log_pos 2629 CRC32 0x0a774705 Query thread_id=7 exec_time=5 error_code=0 SET TIMESTAMP=1555321718/*!*/; XA COMMIT X'31',X'',1 /*!*/; SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/; DELIMITER ; # End of log file /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;