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

LP:947474 - Assertion `table->file->stats.records > 0 || error' failed in join_read_const_table on concurrent SELECT and ALTER, constant Aria table

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      See also https://bugs.launchpad.net/maria/+bug/947487
      The reason of both problems might be the same, as they happen with the exact same test case, but since it fails in both threads, sometimes on SELECT with the assertion and sometimes with the crash on ALTER (bug#947487), I will file both.

      5.5.21-MariaDB-debug-log'
      mysqld: /home/elenst/maria-5.5/sql/sql_select.cc:16119: int join_read_const_table(JOIN_TAB*, POSITION*): Assertion `table->file->stats.records > 0 || error' failed.

      #6 0x00007fd0c2a67235 in __assert_fail () from /lib64/libc.so.6
      #7 0x000000000067d8f0 in join_read_const_table (tab=0x31637a0, pos=0x7fd0a8152180)
          at /home/elenst/maria-5.5/sql/sql_select.cc:16119
      #8 0x000000000065f0fc in make_join_statistics (join=0x7fd0a814e2b8, tables_list=..., conds=0x0,
          keyuse_array=0x7fd0a8156178) at /home/elenst/maria-5.5/sql/sql_select.cc:3288
      #9 0x0000000000657c59 in JOIN::optimize (this=0x7fd0a814e2b8)
          at /home/elenst/maria-5.5/sql/sql_select.cc:1178
      #10 0x000000000065e228 in mysql_select (thd=0x7fd0a8128a20, rref_pointer_array=0x7fd0a812b698,
          tables=0x31621e0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0,
          proc_param=0x0, select_options=2147748608, result=0x3162838, unit=0x7fd0a812ad90,
          select_lex=0x7fd0a812b448) at /home/elenst/maria-5.5/sql/sql_select.cc:2960
      #11 0x00000000006552c6 in handle_select (thd=0x7fd0a8128a20, lex=0x7fd0a812ace0, result=0x3162838,
          setup_tables_done_option=0) at /home/elenst/maria-5.5/sql/sql_select.cc:309
      #12 0x000000000062f3d8 in execute_sqlcom_select (thd=0x7fd0a8128a20, all_tables=0x31621e0)
          at /home/elenst/maria-5.5/sql/sql_parse.cc:4616
      #13 0x000000000062844f in mysql_execute_command (thd=0x7fd0a8128a20)
          at /home/elenst/maria-5.5/sql/sql_parse.cc:2185
      #14 0x0000000000631bec in mysql_parse (thd=0x7fd0a8128a20, rawbuf=0x3161ff8 "SELECT * FROM `B`", length=17,
          parser_state=0x7fd0a4afe670) at /home/elenst/maria-5.5/sql/sql_parse.cc:5730
      #15 0x0000000000625abd in dispatch_command (command=COM_QUERY, thd=0x7fd0a8128a20,
          packet=0x7fd0a812de81 "SELECT * FROM `B`", packet_length=17)
          at /home/elenst/maria-5.5/sql/sql_parse.cc:1056
      #16 0x0000000000624d90 in do_command (thd=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_parse.cc:795
      #17 0x000000000071f729 in do_handle_one_connection (thd_arg=0x7fd0a8128a20)
          at /home/elenst/maria-5.5/sql/sql_connect.cc:1253
      #18 0x000000000071f1ec in handle_one_connection (arg=0x7fd0a8128a20)
          at /home/elenst/maria-5.5/sql/sql_connect.cc:1168
      #19 0x00007fd0c3d77a4f in start_thread () from /lib64/libpthread.so.0
      #20 0x00007fd0c2b0c82d in clone () from /lib64/libc.so.6

      bzr version-info
      revision-id: <email address hidden>
      date: 2012-03-03 13:22:49 -0800
      build-date: 2012-03-05 22:41:54 +0200
      revno: 3311

      Could not reproduce on 5.3.
      Could not convert into an MTR test, it might require a deeper insight into the root of the problem, and possibly usage of synchronization points.

      1. RQG grammar (test.yy):

      partitions:
              ALTER TABLE _table PARTITION BY KEY() PARTITIONS part_num |
              ALTER TABLE _table REMOVE PARTITIONING;

      query:
              SELECT * FROM _table ;

      thread1:
              partitions ;

      part_num:
              1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;

      1. End of RQG grammar
      1. Run as

      perl runall.pl \
      --threads=2 \
      --duration=3600 \
      --queries=100M \
      --grammar=./test.yy \
      --engine=Aria \
      --rows=1,1,1,1,1,1,1,1,1 \
      --mtr-build-thread=300 \
      --basedir1=<5.5 debug basedir> \
      --vardir1=<your vardir>

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Assertion `table->file->stats.records > 0 || error' failed in join_read_const_table on concurrent SELECT and ALTER, constant Aria table
            5.5.21-MariaDB-debug-log'
            mysqld: /home/elenst/maria-5.5/sql/sql_select.cc:16119: int join_read_const_table(JOIN_TAB*, POSITION*): Assertion `table->file->stats.records > 0 || error' failed.

            #6 0x00007fd0c2a67235 in __assert_fail () from /lib64/libc.so.6
            #7 0x000000000067d8f0 in join_read_const_table (tab=0x31637a0, pos=0x7fd0a8152180)
            at /home/elenst/maria-5.5/sql/sql_select.cc:16119
            #8 0x000000000065f0fc in make_join_statistics (join=0x7fd0a814e2b8, tables_list=..., conds=0x0,
            keyuse_array=0x7fd0a8156178) at /home/elenst/maria-5.5/sql/sql_select.cc:3288
            #9 0x0000000000657c59 in JOIN::optimize (this=0x7fd0a814e2b8)
            at /home/elenst/maria-5.5/sql/sql_select.cc:1178
            #10 0x000000000065e228 in mysql_select (thd=0x7fd0a8128a20, rref_pointer_array=0x7fd0a812b698,
            tables=0x31621e0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0,
            proc_param=0x0, select_options=2147748608, result=0x3162838, unit=0x7fd0a812ad90,
            select_lex=0x7fd0a812b448) at /home/elenst/maria-5.5/sql/sql_select.cc:2960
            #11 0x00000000006552c6 in handle_select (thd=0x7fd0a8128a20, lex=0x7fd0a812ace0, result=0x3162838,
            setup_tables_done_option=0) at /home/elenst/maria-5.5/sql/sql_select.cc:309
            #12 0x000000000062f3d8 in execute_sqlcom_select (thd=0x7fd0a8128a20, all_tables=0x31621e0)
            at /home/elenst/maria-5.5/sql/sql_parse.cc:4616
            #13 0x000000000062844f in mysql_execute_command (thd=0x7fd0a8128a20)
            at /home/elenst/maria-5.5/sql/sql_parse.cc:2185
            #14 0x0000000000631bec in mysql_parse (thd=0x7fd0a8128a20, rawbuf=0x3161ff8 "SELECT * FROM `B`", length=17,
            parser_state=0x7fd0a4afe670) at /home/elenst/maria-5.5/sql/sql_parse.cc:5730
            #15 0x0000000000625abd in dispatch_command (command=COM_QUERY, thd=0x7fd0a8128a20,
            packet=0x7fd0a812de81 "SELECT * FROM `B`", packet_length=17)
            at /home/elenst/maria-5.5/sql/sql_parse.cc:1056
            #16 0x0000000000624d90 in do_command (thd=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_parse.cc:795
            #17 0x000000000071f729 in do_handle_one_connection (thd_arg=0x7fd0a8128a20)
            at /home/elenst/maria-5.5/sql/sql_connect.cc:1253
            #18 0x000000000071f1ec in handle_one_connection (arg=0x7fd0a8128a20)
            at /home/elenst/maria-5.5/sql/sql_connect.cc:1168
            #19 0x00007fd0c3d77a4f in start_thread () from /lib64/libpthread.so.0
            #20 0x00007fd0c2b0c82d in clone () from /lib64/libc.so.6

            bzr version-info
            revision-id: igor@askmonty.org-20120303212249-smj4ixph46c126he
            date: 2012-03-03 13:22:49 -0800
            build-date: 2012-03-05 22:41:54 +0200
            revno: 3311

            Could not reproduce on 5.3.
            Could not convert into an MTR test, it might require deeper inside into the root of the problem, and possibly usage of synchronization points.

            1. RQG grammar (test.yy):

            partitions:
            ALTER TABLE _table PARTITION BY KEY() PARTITIONS part_num |
            ALTER TABLE _table REMOVE PARTITIONING;

            query:
            SELECT * FROM _table ;

            thread1:
            partitions ;

            part_num:
            1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;

            1. End of RQG grammar
            1. Run as

            perl runall.pl \
            --threads=2 \
            --duration=3600 \
            --queries=100M \
            --grammar=./test.yy \
            --engine=Aria \
            --rows=1,1,1,1,1,1,1,1,1 \
            --mtr-build-thread=300 \
            --basedir1=<5.5 debug basedir> \
            --vardir1=<your vardir>

            Show
            elenst Elena Stepanova added a comment - Assertion `table->file->stats.records > 0 || error' failed in join_read_const_table on concurrent SELECT and ALTER, constant Aria table 5.5.21-MariaDB-debug-log' mysqld: /home/elenst/maria-5.5/sql/sql_select.cc:16119: int join_read_const_table(JOIN_TAB*, POSITION*): Assertion `table->file->stats.records > 0 || error' failed. #6 0x00007fd0c2a67235 in __assert_fail () from /lib64/libc.so.6 #7 0x000000000067d8f0 in join_read_const_table (tab=0x31637a0, pos=0x7fd0a8152180) at /home/elenst/maria-5.5/sql/sql_select.cc:16119 #8 0x000000000065f0fc in make_join_statistics (join=0x7fd0a814e2b8, tables_list=..., conds=0x0, keyuse_array=0x7fd0a8156178) at /home/elenst/maria-5.5/sql/sql_select.cc:3288 #9 0x0000000000657c59 in JOIN::optimize (this=0x7fd0a814e2b8) at /home/elenst/maria-5.5/sql/sql_select.cc:1178 #10 0x000000000065e228 in mysql_select (thd=0x7fd0a8128a20, rref_pointer_array=0x7fd0a812b698, tables=0x31621e0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x3162838, unit=0x7fd0a812ad90, select_lex=0x7fd0a812b448) at /home/elenst/maria-5.5/sql/sql_select.cc:2960 #11 0x00000000006552c6 in handle_select (thd=0x7fd0a8128a20, lex=0x7fd0a812ace0, result=0x3162838, setup_tables_done_option=0) at /home/elenst/maria-5.5/sql/sql_select.cc:309 #12 0x000000000062f3d8 in execute_sqlcom_select (thd=0x7fd0a8128a20, all_tables=0x31621e0) at /home/elenst/maria-5.5/sql/sql_parse.cc:4616 #13 0x000000000062844f in mysql_execute_command (thd=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_parse.cc:2185 #14 0x0000000000631bec in mysql_parse (thd=0x7fd0a8128a20, rawbuf=0x3161ff8 "SELECT * FROM `B`", length=17, parser_state=0x7fd0a4afe670) at /home/elenst/maria-5.5/sql/sql_parse.cc:5730 #15 0x0000000000625abd in dispatch_command (command=COM_QUERY, thd=0x7fd0a8128a20, packet=0x7fd0a812de81 "SELECT * FROM `B`", packet_length=17) at /home/elenst/maria-5.5/sql/sql_parse.cc:1056 #16 0x0000000000624d90 in do_command (thd=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_parse.cc:795 #17 0x000000000071f729 in do_handle_one_connection (thd_arg=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_connect.cc:1253 #18 0x000000000071f1ec in handle_one_connection (arg=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_connect.cc:1168 #19 0x00007fd0c3d77a4f in start_thread () from /lib64/libpthread.so.0 #20 0x00007fd0c2b0c82d in clone () from /lib64/libc.so.6 bzr version-info revision-id: igor@askmonty.org-20120303212249-smj4ixph46c126he date: 2012-03-03 13:22:49 -0800 build-date: 2012-03-05 22:41:54 +0200 revno: 3311 Could not reproduce on 5.3. Could not convert into an MTR test, it might require deeper inside into the root of the problem, and possibly usage of synchronization points. RQG grammar (test.yy): partitions: ALTER TABLE _table PARTITION BY KEY() PARTITIONS part_num | ALTER TABLE _table REMOVE PARTITIONING; query: SELECT * FROM _table ; thread1: partitions ; part_num: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ; End of RQG grammar Run as perl runall.pl \ --threads=2 \ --duration=3600 \ --queries=100M \ --grammar=./test.yy \ --engine=Aria \ --rows=1,1,1,1,1,1,1,1,1 \ --mtr-build-thread=300 \ --basedir1=<5.5 debug basedir> \ --vardir1=<your vardir>
            Hide
            elenst Elena Stepanova added a comment -

            Re: Assertion `table->file->stats.records > 0 || error' failed in join_read_const_table on concurrent SELECT and ALTER, constant Aria table
            Also filed as JIRA issue MDEV-170

            Show
            elenst Elena Stepanova added a comment - Re: Assertion `table->file->stats.records > 0 || error' failed in join_read_const_table on concurrent SELECT and ALTER, constant Aria table Also filed as JIRA issue MDEV-170
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 947474

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 947474

              People

              • Assignee:
                monty Michael Widenius
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: