Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32771

Server crash or assertion failure upon online alter with concurrent XA

    XMLWordPrintable

Details

    Description

      The test case is non-deterministic, run with --repeat=N. It usually fails for me within a few attempts. Please don't put it into the regression suite, create a deterministic one instead.

      --source include/have_sequence.inc
       
      CREATE TABLE t (a INT);
      INSERT INTO t SELECT seq FROM seq_1_to_1000;
       
      --connect (con1,localhost,root,,)
      XA START 'xid';
       
      --connection default
      --send
        ALTER TABLE t FORCE, ALGORITHM=COPY;
       
      --connection con1
      SELECT * FROM t LIMIT 0;
      --error 0,ER_LOCK_DEADLOCK
      UPDATE t SET a = 0;
      --error 0,ER_XA_RBDEADLOCK
      XA END 'xid';
      --error 0,ER_XAER_RMFAIL
      XA PREPARE 'xid';
      XA ROLLBACK 'xid';
       
      # Cleanup
      DROP TABLE t;
      --disconnect con1
      

      bb-11.2-release c028e25c non-debug

      #2  <signal handler called>
      #3  0x00005608dfad9451 in ilist<online_alter_cache_data, void>::empty (this=0x0) at /data/src/bb-11.2-release/include/ilist.h:159
      #4  online_alter_end_trans (cache_list=..., thd=thd@entry=0x7f74ac000c68, is_ending_transaction=is_ending_transaction@entry=true, commit=commit@entry=false) at /data/src/bb-11.2-release/sql/online_alter.cc:211
      #5  0x00005608dfad97fd in online_alter_rollback (hton=0x5608e2c80f08, thd=0x7f74ac000c68, all=<optimized out>) at /data/src/bb-11.2-release/sql/online_alter.cc:113
      #6  0x00005608df977fc0 in ha_rollback_trans (thd=thd@entry=0x7f74ac000c68, all=all@entry=true) at /data/src/bb-11.2-release/sql/handler.cc:2264
      #7  0x00005608df903427 in xa_trans_force_rollback (thd=thd@entry=0x7f74ac000c68) at /data/src/bb-11.2-release/sql/xa.cc:404
      #8  0x00005608df904489 in trans_xa_rollback (thd=thd@entry=0x7f74ac000c68) at /data/src/bb-11.2-release/sql/xa.cc:883
      #9  0x00005608df727850 in mysql_execute_command (thd=thd@entry=0x7f74ac000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/src/bb-11.2-release/sql/sql_parse.cc:5660
      #10 0x00005608df72a215 in mysql_parse (thd=0x7f74ac000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /data/src/bb-11.2-release/sql/sql_parse.cc:7808
      #11 0x00005608df72c155 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f74ac000c68, packet=packet@entry=0x7f74ac008819 "XA ROLLBACK 'xid'", packet_length=packet_length@entry=17, blocking=blocking@entry=true) at /data/src/bb-11.2-release/sql/sql_parse.cc:1992
      #12 0x00005608df72d767 in do_command (thd=0x7f74ac000c68, blocking=blocking@entry=true) at /data/src/bb-11.2-release/sql/sql_parse.cc:1406
      #13 0x00005608df8447e7 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5608e3110f18, put_in_cache=put_in_cache@entry=true) at /data/src/bb-11.2-release/sql/sql_connect.cc:1418
      #14 0x00005608df844b7d in handle_one_connection (arg=arg@entry=0x5608e3110f18) at /data/src/bb-11.2-release/sql/sql_connect.cc:1320
      #15 0x00005608dfb69617 in pfs_spawn_thread (arg=0x5608e30921f8) at /data/src/bb-11.2-release/storage/perfschema/pfs.cc:2201
      #16 0x00007f74c8aa8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #17 0x00007f74c8b2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      bb-11.2-release 634f8b13 debug

      mariadbd: /data/src/bb-11.2-release/sql/online_alter.cc:112: Online_alter_cache_list& get_cache_list(handlerton*, THD*): Assertion `data' failed.
      231110 18:33:41 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007f00b7053e32 in __GI___assert_fail (assertion=0x5589f37714b5 "data", file=0x5589f37714c0 "/data/src/bb-11.2-release/sql/online_alter.cc", line=112, function=0x5589f37714f0 "Online_alter_cache_list& get_cache_list(handlerton*, THD*)") at ./assert/assert.c:101
      #10 0x00005589f2cf224a in get_cache_list (ht=0x5589f50c2fc8, thd=0x7f0094000dc8) at /data/src/bb-11.2-release/sql/online_alter.cc:112
      #11 0x00005589f2cf2fdc in online_alter_rollback (hton=0x5589f50c2fc8, thd=0x7f0094000dc8, all=true) at /data/src/bb-11.2-release/sql/online_alter.cc:326
      #12 0x00005589f2ae7c2e in ha_rollback_trans (thd=0x7f0094000dc8, all=true) at /data/src/bb-11.2-release/sql/handler.cc:2264
      #13 0x00005589f2a14ee7 in xa_trans_force_rollback (thd=0x7f0094000dc8) at /data/src/bb-11.2-release/sql/xa.cc:404
      #14 0x00005589f2a16947 in trans_xa_rollback (thd=0x7f0094000dc8) at /data/src/bb-11.2-release/sql/xa.cc:883
      #15 0x00005589f26d8aed in mysql_execute_command (thd=0x7f0094000dc8, is_called_from_prepared_stmt=false) at /data/src/bb-11.2-release/sql/sql_parse.cc:5660
      #16 0x00005589f26df443 in mysql_parse (thd=0x7f0094000dc8, rawbuf=0x7f00940141b0 "XA ROLLBACK 'xid'", length=17, parser_state=0x7f00b1809330) at /data/src/bb-11.2-release/sql/sql_parse.cc:7808
      #17 0x00005589f26cc008 in dispatch_command (command=COM_QUERY, thd=0x7f0094000dc8, packet=0x7f009400bc49 "XA ROLLBACK 'xid'", packet_length=17, blocking=true) at /data/src/bb-11.2-release/sql/sql_parse.cc:1893
      #18 0x00005589f26ca961 in do_command (thd=0x7f0094000dc8, blocking=true) at /data/src/bb-11.2-release/sql/sql_parse.cc:1406
      #19 0x00005589f28c5b84 in do_handle_one_connection (connect=0x5589f55a65b8, put_in_cache=true) at /data/src/bb-11.2-release/sql/sql_connect.cc:1418
      #20 0x00005589f28c58f9 in handle_one_connection (arg=0x5589f55a65b8) at /data/src/bb-11.2-release/sql/sql_connect.cc:1320
      #21 0x00005589f2e08488 in pfs_spawn_thread (arg=0x5589f55a6698) at /data/src/bb-11.2-release/storage/perfschema/pfs.cc:2201
      #22 0x00007f00b70a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #23 0x00007f00b712861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Same happens with XA COMMIT instead of XA ROLLBACK, with a corresponding difference in the stack trace.

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.