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

Assertion `rec_get_trx_id(rec, clust_index) < trx->id' failed in row_merge_read_clustered_index

    XMLWordPrintable

Details

    Description

      This is a continuation of MDEV-33547. It was closed as not fixable in 10.5; this one is for 10.6 (and probably higher versions) and a different failing assertion, so I've created a new one instead of re-opening MDEV-33547 to avoid confusion in case you decide to fix this. Still, the scenario is unlikely, so I'm setting it to Minor, feel free to close it as "Won't fix", too.

      The scenario again involves concurrent OPTIMIZE on a normal table and a statistical table. This time I couldn't get enough concurrency in MTR (It does still happen in MTR, but it takes too long and is too unreliable). The RQG test below reproduces it for me in the matter of seconds. It is also rr-able.

      As of now, I can only reproduce the assertion failure on 10.6. 10.5 fails on the assertion from MDEV-33547, while 10.6.17 release and current 10.11+ branches end up in a deadlock instead. Probably the difference comes from the MDEV-33462 fix which is now in 10.6 but not in higher branches yet.

      10.6 33dcf8155b4a215c9f24ab92f5274bc51503b6f2

      mysqld: /data/MDEV-33575/10.6/storage/innobase/row/row0merge.cc:2181: dberr_t row_merge_read_clustered_index(trx_t*, TABLE*, const dict_table_t*, dict_table_t*, bool, dict_index_t**, dict_index_t*, fts_psort_t*, merge_file_t*, const ulint*, ulint, const dtuple_t*, const dict_add_v_col_t*, const ulint*, ulint, ib_sequence_t&, row_merge_block_t*, bool, pfs_os_file_t*, ut_stage_alter_t*, double, row_merge_block_t*, TABLE*, bool, const col_collations*): Assertion `rec_get_trx_id(rec, clust_index) < trx->id' failed.
       
      (rr) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000044bd59d09859 in __GI_abort () at abort.c:79
      #2  0x000044bd59d09729 in __assert_fail_base (fmt=0x44bd59e9f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55e1b213f830 "rec_get_trx_id(rec, clust_index) < trx->id", 
          file=0x55e1b213e5f0 "/data/MDEV-33575/10.6/storage/innobase/row/row0merge.cc", line=2181, function=<optimized out>) at assert.c:92
      #3  0x000044bd59d1afd6 in __GI___assert_fail (assertion=0x55e1b213f830 "rec_get_trx_id(rec, clust_index) < trx->id", file=0x55e1b213e5f0 "/data/MDEV-33575/10.6/storage/innobase/row/row0merge.cc", 
          line=2181, 
          function=0x55e1b213f3a8 "dberr_t row_merge_read_clustered_index(trx_t*, TABLE*, const dict_table_t*, dict_table_t*, bool, dict_index_t**, dict_index_t*, fts_psort_t*, merge_file_t*, const ulint*, ulint, const dtuple_t*, const"...) at assert.c:101
      #4  0x000055e1b1957e29 in row_merge_read_clustered_index (trx=0x6fec570f4b80, table=0x1f206b63ccf0, old_table=0x36de78031eb0, new_table=0x55e1b50cc150, online=false, index=0x36de78188608, 
          fts_sort_idx=0x0, psort_info=0x0, files=0x36de7817aaf0, key_numbers=0x36de78188610, n_index=1, defaults=0x0, add_v=0x0, col_map=0x36de781ae8e0, add_autoinc=18446744073709551615, sequence=..., 
          block=0x4960e8d4000 "", skip_pk_sort=true, tmpfd=0x1f206b63be58, stage=0x36de7812a270, pct_cost=50, crypt_block=0x0, eval_table=0x1f206b63ccf0, allow_not_null=false, col_collate=0x0)
          at /data/MDEV-33575/10.6/storage/innobase/row/row0merge.cc:2181
      #5  0x000055e1b195ff83 in row_merge_build_indexes (trx=0x6fec570f4b80, old_table=0x36de78031eb0, new_table=0x55e1b50cc150, online=false, indexes=0x36de78188608, key_numbers=0x36de78188610, n_indexes=1, 
          table=0x1f206b63ccf0, defaults=0x0, col_map=0x36de781ae8e0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=true, stage=0x36de7812a270, add_v=0x0, eval_table=0x1f206b63ccf0, 
          allow_not_null=false, col_collate=0x0) at /data/MDEV-33575/10.6/storage/innobase/row/row0merge.cc:4554
      #6  0x000055e1b17f75a6 in ha_innobase::inplace_alter_table (this=0x36de781b5060, altered_table=0x1f206b63ccf0, ha_alter_info=0x1f206b63cc30)
          at /data/MDEV-33575/10.6/storage/innobase/handler/handler0alter.cc:8811
      #7  0x000055e1b11cf32d in handler::ha_inplace_alter_table (this=0x36de781b5060, altered_table=0x1f206b63ccf0, ha_alter_info=0x1f206b63cc30) at /data/MDEV-33575/10.6/sql/handler.h:4699
      #8  0x000055e1b11bfe4d in mysql_inplace_alter_table (thd=0x36de78001628, table_list=0x36de78013ba8, table=0x36de78180b78, altered_table=0x1f206b63ccf0, ha_alter_info=0x1f206b63cc30, 
          target_mdl_request=0x1f206b63d5b0, ddl_log_state=0x1f206b63cbf0, trigger_param=0x1f206b63d120, alter_ctx=0x1f206b63e170) at /data/MDEV-33575/10.6/sql/sql_table.cc:7529
      #9  0x000055e1b11c94a9 in mysql_alter_table (thd=0x36de78001628, new_db=0x55e1b1e63e30 <null_clex_str>, new_name=0x55e1b1e63e30 <null_clex_str>, create_info=0x1f206b63efc0, table_list=0x36de78013ba8, 
          recreate_info=0x1f206b63f400, alter_info=0x1f206b63ee50, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/MDEV-33575/10.6/sql/sql_table.cc:10566
      #10 0x000055e1b11ccd2e in mysql_recreate_table (thd=0x36de78001628, table_list=0x36de78013ba8, recreate_info=0x1f206b63f400, table_copy=false) at /data/MDEV-33575/10.6/sql/sql_table.cc:11622
      #11 0x000055e1b127ddcf in admin_recreate_table (thd=0x36de78001628, table_list=0x36de78013ba8, recreate_info=0x1f206b63f400) at /data/MDEV-33575/10.6/sql/sql_admin.cc:72
      #12 0x000055e1b12813bc in mysql_admin_table (thd=0x36de78001628, tables=0x36de78013ba8, check_opt=0x36de78006b08, operator_name=0x55e1b27818b0 <msg_optimize>, lock_type=TL_WRITE, org_open_for_modify=true, 
          repair_table_use_frm=false, extra_open_options=0, prepare_func=0x0, operator_func=
          (int (handler::*)(class handler * const, class THD *, HA_CHECK_OPT *)) 0x55e1b144c0f0 <handler::ha_optimize(THD*, st_ha_check_opt*)>, view_operator_func=0x0, is_cmd_replicated=true)
          at /data/MDEV-33575/10.6/sql/sql_admin.cc:1229
      #13 0x000055e1b12827b6 in Sql_cmd_optimize_table::execute (this=0x36de780142b0, thd=0x36de78001628) at /data/MDEV-33575/10.6/sql/sql_admin.cc:1614
      #14 0x000055e1b10caf03 in mysql_execute_command (thd=0x36de78001628, is_called_from_prepared_stmt=false) at /data/MDEV-33575/10.6/sql/sql_parse.cc:6117
      #15 0x000055e1b10d0a3a in mysql_parse (thd=0x36de78001628, rawbuf=0x36de78013a70 "/* WRK-1 QNO 565 */ OPTIMIZE TABLE mysql.innodb_index_stats", length=59, parser_state=0x1f206b640350)
          at /data/MDEV-33575/10.6/sql/sql_parse.cc:8143
      #16 0x000055e1b10bd509 in dispatch_command (command=COM_QUERY, thd=0x36de78001628, packet=0x36de7800b699 "", packet_length=59, blocking=true) at /data/MDEV-33575/10.6/sql/sql_parse.cc:1896
      #17 0x000055e1b10bc106 in do_command (thd=0x36de78001628, blocking=true) at /data/MDEV-33575/10.6/sql/sql_parse.cc:1409
      #18 0x000055e1b12690b1 in do_handle_one_connection (connect=0x55e1b5083a78, put_in_cache=true) at /data/MDEV-33575/10.6/sql/sql_connect.cc:1415
      #19 0x000055e1b1268e3d in handle_one_connection (arg=0x55e1b5083a78) at /data/MDEV-33575/10.6/sql/sql_connect.cc:1317
      #20 0x00004d7f291da609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #21 0x000044bd59e06133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      randgen branch mdev33575

      perl ./run.pl --grammar=mdev33575.yy --threads=2 --duration=120 --mysqld=--max-statement-time=5 --vardir=/dev/shm/var-mdev33575 --nometadata-reload --gendata=simple --basedir=/data/MDEV-33575/10.6 --rr
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Git Integration

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