codership / galera

Synchronous multi-master replication library
GNU General Public License v2.0
444 stars 177 forks source link

InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno in trx0sys.cc line 356 #382

Open rameshvs02 opened 8 years ago

rameshvs02 commented 8 years ago

Error info

2016-01-05 15:48:57 7f57003cb700  InnoDB: Assertion failure in thread 140011642861312 in file trx0sys.cc line 356
InnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
12:48:57 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
Please help us make Percona XtraDB Cluster better by reporting any
bugs at https://bugs.launchpad.net/percona-xtradb-cluster

key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=4
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61966 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f56d00009a0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f57003caae0 thread_stack 0x40000
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(my_print_stacktrace+0x47)[0xb37712]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(handle_fatal_signal+0x43c)[0x76e4e6]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10)[0x7f571351dd10]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f57128d7267]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f57128d8eca]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(_Z31trx_sys_update_wsrep_checkpointPK5xid_tPhP5mtr_t+0x95)[0xd35466]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld[0xbb1a66]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld[0x93c467]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(_Z24plugin_foreach_with_maskP3THDPFcS0_PP13st_plugin_intPvEijS4_+0x2e8)[0x84985c]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(_Z23wsrep_set_SE_checkpointR5xid_t+0x2e)[0x93c4b0]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(_Z23wsrep_set_SE_checkpointRK10wsrep_uuidl+0x66)[0x93c519]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld[0x664233]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(_Z15wsrep_commit_cbPvjPK14wsrep_trx_metaPbb+0xa3)[0x6643fc]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so(_ZN6galera13ReplicatorSMM9apply_trxEPvPNS_9TrxHandleE+0x2ce)[0x7f5711d7d09e]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so(_ZN6galera13ReplicatorSMM11process_trxEPvPNS_9TrxHandleE+0x1d4)[0x7f5711d81330]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so(_ZN6galera15GcsActionSource8dispatchEPvRK10gcs_actionRb+0x1a7)[0x7f5711d5e023]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so(_ZN6galera15GcsActionSource7processEPvRb+0xaf)[0x7f5711d5e7f3]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so(_ZN6galera13ReplicatorSMM10async_recvEPv+0x1b6)[0x7f5711d7c7f2]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so(galera_recv+0x92)[0x7f5711d9b384]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld[0x665a67]
/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/bin/mysqld(start_wsrep_THD+0x3e3)[0x64000b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76aa)[0x7f57135146aa]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f57129a8eed]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 3
Status: NOT_KILLED

You may download the Percona XtraDB Cluster operations manual by visiting
http://www.percona.com/software/percona-xtradb-cluster/. You may find information
in the manual which will help you identify the cause of the crash.
Writing a core file

How to reproduce


1) Start two node cluster
cd Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/mysql-test/

perl mysql-test-run.pl --start-and-exit --port-base=19000 --nowarnings --vardir=/sda/workdir/1001/node1 --mysqld=--skip-performance-schema --mysqld=--innodb_file_per_table --mysqld=--default-storage-engine=InnoDB --mysqld=--binlog-format=ROW --mysqld=--log-bin --mysqld=--server-id=100 --mysqld=--gtid-mode=ON --mysqld=--log-slave-updates --mysqld=--enforce-gtid-consistency --mysqld=--wsrep-slave-threads=2 --mysqld=--innodb_autoinc_lock_mode=2 --mysqld=--innodb_locks_unsafe_for_binlog=1 --mysqld=--wsrep-provider=/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so --mysqld=--wsrep_cluster_address=gcomm:// --mysqld=--wsrep_sst_receive_address=127.0.0.1:19007 --mysqld=--wsrep_node_incoming_address=127.0.0.1 --mysqld=--wsrep_provider_options=gmcast.listen_addr=tcp://127.0.0.1:19008 --mysqld=--wsrep_sst_method=rsync --mysqld=--wsrep_sst_auth=root: --mysqld=--wsrep_node_address=127.0.0.1 --mysqld=--innodb_flush_method=O_DIRECT --mysqld=--core-file --mysqld=--loose-new --mysqld=--sql-mode=no_engine_substitution --mysqld=--loose-innodb --mysqld=--secure-file-priv= --mysqld=--loose-innodb-status-file=1 --mysqld=--skip-name-resolve --mysqld=--socket=/sda/workdir/1001/node1.sock --mysqld=--log-error=/sda/workdir/1001/node1/node1.err --mysqld=--log-output=none 1st

perl mysql-test-run.pl --start-and-exit --port-base=19100 --nowarnings --vardir=/sda/workdir/1001/node2 --mysqld=--skip-performance-schema --mysqld=--innodb_file_per_table --mysqld=--default-storage-engine=InnoDB --mysqld=--binlog-format=ROW --mysqld=--log-bin --mysqld=--server-id=101 --mysqld=--gtid-mode=ON --mysqld=--log-slave-updates --mysqld=--enforce-gtid-consistency --mysqld=--wsrep-slave-threads=2 --mysqld=--innodb_autoinc_lock_mode=2 --mysqld=--innodb_locks_unsafe_for_binlog=1 --mysqld=--wsrep-provider=/sda/workdir/Percona-XtraDB-Cluster-5.6.27-rel76.0-25.13-debug.Linux.x86_64/lib/libgalera_smm.so --mysqld=--wsrep_cluster_address=gcomm://127.0.0.1:19008 --mysqld=--wsrep_sst_receive_address=127.0.0.1:19107 --mysqld=--wsrep_node_incoming_address=127.0.0.1 --mysqld=--wsrep_provider_options=gmcast.listen_addr=tcp://127.0.0.1:19108 --mysqld=--wsrep_sst_method=rsync --mysqld=--wsrep_sst_auth=root: --mysqld=--wsrep_node_address=127.0.0.1 --mysqld=--innodb_flush_method=O_DIRECT --mysqld=--core-file --mysqld=--loose-new --mysqld=--sql-mode=no_engine_substitution --mysqld=--loose-innodb --mysqld=--secure-file-priv= --mysqld=--loose-innodb-status-file=1 --mysqld=--skip-name-resolve --mysqld=--log-error=/sda/workdir/1001/node2/node2.err --mysqld=--socket=/sda/workdir/1001/node2.sock --mysqld=--log-output=none 1st

2) Create dsns table for executing pt-table-checksum
mysql -h127.0.0.1 -P19000 -uroot

drop database if exists percona;create database percona;
drop table if exists percona.dsns;create table percona.dsns(id int,parent_id int,dsn varchar(100));
insert into percona.dsns (id,dsn) values (1,'h=127.0.0.1,P=19000,u=root'),(2,'h=127.0.0.1,P=19100,u=root');

3) Execute pt-table-checksum (Node2 is crashing when we execute pt-table-checksum)
pt-table-checksum h=127.0.0.1,P=19000,u=root -d mysql --recursion-method dsn=h=127.0.0.1,P=19000,u=root,D=percona,t=dsns --no-check-binlog-format

kbauskar commented 8 years ago

This should be simpler TC

  1. Start 2 node cluster.

Ensure that following is set besides default configuration log-slave-updates=true gtid-mode=on enforce-gtid-consistency=true

  1. Execute following on node-1

use test; create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb; insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3); create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb; replace into t2 (i, j, k) select /!99997/ i, k, j from t1;

  1. Observer node-2 crash.

REPLACE stmt execute as TOI and newly added check to persist SE checkpoint for TOI based query causes double persistence of same seqno.


REPLACE ... SELECT (or for that matter INSERT ... SELECT) which are DML stmt are being executed in TOI fashion and code try to initiate initial commit for DML that causes seqno-persistence and again TOI causes the same seqno persistence.

So may be apply_wsrep_toi should be ANDed (&&) to consider a special case where-in DML is running as TOI.