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

Server crashes in maria_create_trn_for_mysql upon ALTER TABLE

    Details

      Description

      CREATE TABLE t1 (a INT) ENGINE=Aria;
      CREATE TABLE t2 (b INT) ENGINE=Aria;
      CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2 ;
       
      LOCK TABLES t1 WRITE, t2 AS t2a WRITE, v2 WRITE CONCURRENT, t2 WRITE;
       
      ALTER TABLE t1 FORCE;
      ALTER TABLE t2 CHANGE b c VARBINARY(30000), ALGORITHM=INPLACE;
       
      # Cleanup
      UNLOCK TABLES;
      DROP VIEW v2;
      DROP TABLE t1, t2;
      

      10.2 bc8d173b

      #3  <signal handler called>
      #4  0x000055a3c1c05381 in maria_create_trn_for_mysql (info=0x7f3f9405fb60) at /data/src/10.2/storage/maria/ha_maria.cc:925
      #5  0x000055a3c1bf437a in _ma_setup_live_state (info=0x7f3f9405fb60) at /data/src/10.2/storage/maria/ma_state.c:65
      #6  0x000055a3c1c0abf7 in ha_maria::implicit_commit (thd=0x7f3f94000b00, new_trn=true) at /data/src/10.2/storage/maria/ha_maria.cc:2943
      #7  0x000055a3c19fcb1b in ha_commit_trans (thd=0x7f3f94000b00, all=true) at /data/src/10.2/sql/handler.cc:1356
      #8  0x000055a3c18e1af1 in trans_commit_implicit (thd=0x7f3f94000b00) at /data/src/10.2/sql/transaction.cc:368
      #9  0x000055a3c1787b69 in mysql_execute_command (thd=0x7f3f94000b00) at /data/src/10.2/sql/sql_parse.cc:6339
      #10 0x000055a3c178c565 in mysql_parse (thd=0x7f3f94000b00, rawbuf=0x7f3f94012458 "ALTER TABLE t2 CHANGE b c VARBINARY(30000), ALGORITHM=INPLACE", length=61, parser_state=0x7f3fa41d3200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8013
      #11 0x000055a3c177a062 in dispatch_command (command=COM_QUERY, thd=0x7f3f94000b00, packet=0x7f3f9408d761 "ALTER TABLE t2 CHANGE b c VARBINARY(30000), ALGORITHM=INPLACE", packet_length=61, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #12 0x000055a3c177897f in do_command (thd=0x7f3f94000b00) at /data/src/10.2/sql/sql_parse.cc:1386
      #13 0x000055a3c18cc069 in do_handle_one_connection (connect=0x55a3c3c79b00) at /data/src/10.2/sql/sql_connect.cc:1335
      #14 0x000055a3c18cbdf6 in handle_one_connection (arg=0x55a3c3c79b00) at /data/src/10.2/sql/sql_connect.cc:1241
      #15 0x000055a3c1cf40fa in pfs_spawn_thread (arg=0x55a3c3bdd870) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #16 0x00007f3fabfec494 in start_thread (arg=0x7f3fa41d4700) at pthread_create.c:333
      #17 0x00007f3fa9fb493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Couldn't reproduce on 10.4, and there is no evidence that it happens there.
      Couldn't reproduce with the test case above on 10.1, although the failure has been seen earlier in concurrent tests on 10.1, see the stack trace below.

      The test case is fragile, even small changes often make MDEV-15572 start happening instead.

      10.1 6e2af7d0

      #3  <signal handler called>
      #4  0x00005644c5bdcbb5 in maria_create_trn_for_mysql (info=0x7ff8740a4620) at /home/vsts/src/storage/maria/ha_maria.cc:914
      #5  0x00005644c5bcbe0a in _ma_setup_live_state (info=0x7ff8740a4620) at /home/vsts/src/storage/maria/ma_state.c:65
      #6  0x00005644c5be22b0 in ha_maria::implicit_commit (thd=0x5644c86dcc70, new_trn=true) at /home/vsts/src/storage/maria/ha_maria.cc:2929
      #7  0x00005644c5a0f8dd in ha_commit_trans (thd=0x5644c86dcc70, all=true) at /home/vsts/src/sql/handler.cc:1357
      #8  0x00005644c59172a4 in trans_commit_implicit (thd=0x5644c86dcc70) at /home/vsts/src/sql/transaction.cc:294
      #9  0x00005644c57d5ab2 in mysql_execute_command (thd=0x5644c86dcc70) at /home/vsts/src/sql/sql_parse.cc:5814
      #10 0x00005644c57d9f13 in mysql_parse (thd=0x5644c86dcc70, rawbuf=0x7ff868012828 "ALTER IGNORE TABLE `table0_aria_int_autoinc` DROP FOREIGN KEY f /* 100307, ALGORITHM=NOCOPY */, LOCK=SHARED /* QNO 387 CON_ID 11 */", length=131, parser_state=0x7ff8cc151670) at /home/vsts/src/sql/sql_parse.cc:7468
      #11 0x00005644c57c8437 in dispatch_command (command=COM_QUERY, thd=0x5644c86dcc70, packet=0x5644c86e4111 "ALTER IGNORE TABLE `table0_aria_int_autoinc` DROP FOREIGN KEY f /*!100307, ALGORITHM=NOCOPY */, LOCK=SHARED /* QNO 387 CON_ID 11 */ ", packet_length=132) at /home/vsts/src/sql/sql_parse.cc:1496
      #12 0x00005644c57c71a9 in do_command (thd=0x5644c86dcc70) at /home/vsts/src/sql/sql_parse.cc:1124
      #13 0x00005644c59028f2 in do_handle_one_connection (thd_arg=0x5644c86dcc70) at /home/vsts/src/sql/sql_connect.cc:1330
      #14 0x00005644c5902641 in handle_one_connection (arg=0x5644c86dcc70) at /home/vsts/src/sql/sql_connect.cc:1242
      #15 0x00007ff8cffd46ba in start_thread (arg=0x7ff8cc152b00) at pthread_create.c:333
      #16 0x00007ff8cf67f41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
       
      Query (0x7ff868012828): ALTER IGNORE TABLE `table0_aria_int_autoinc` DROP FOREIGN KEY f /* 100307, ALGORITHM=NOCOPY */, LOCK=SHARED /* QNO 387 CON_ID 11 */
      Connection ID (thread ID): 11
      Status: NOT_KILLED
      

      Logs and data from 10.1 occurrence are attached.

        Attachments

        1. data-test007.zip
          3.16 MB
        2. mysql.err
          6 kB
        3. threads
          43 kB
        4. threads_full
          140 kB

          Issue Links

            Activity

              People

              • Assignee:
                vlad.lesin Vladislav Lesin
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: