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

InnoDB: Error: trying to access page number 0 in space 5, Assertion failure in file fil0fil.cc line 6109

    XMLWordPrintable

    Details

      Description

      In general, the steps to reproduce are:

      • start server with innodb-page-size=32K or 64K;
      • run some DDL/DML flow;
      • shut down the server (clean shut down or crash, does not matter);
      • start the server again;
      • access tables.

      The failure happens on at least 3 different machines, so it's not a local environmental issue.

      The effect somehow depends on the flow. A crude MTR test is attached, it's big and ugly (although it only runs a few minutes on a normal machine), but I couldn't remove much else, even SELECT statements. Also, with this particular test on my machine the failure only happens when I run it in shm, but in general it's not necessary, I've seen the same effect without shm. Thus, there is no guarantee that the same test will work on every machine.

      The test needs to be run with

      --mysqld=--innodb-page-size=32K --mysqld=--innodb-buffer-pool-size=128M --mysqld=--default-storage-engine=InnoDB
      

      It looks like the problem appeared in 10.1 some time between 10.1.10 and 10.1.15, at least for me on my machine it's reproducible on 10.1.15 release bintar and not reproducible on 10.1.10 release bintar.

      Reproducible on current 10.1 (ebb8c9fb26) as well as bb-10.1-mdev-11623 (889b61b57e42).

      10.1 ebb8c9fb26

      Version: '10.1.21-MariaDB-debug'  socket: '/data/bld/10.1/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
      2017-01-15  3:21:00 139676368124672 [Note] InnoDB: Read page 0 from tablespace for space 4 name test/A key_id 0 encryption 0 ha
      ndle 43.
      2017-01-15  3:21:00 139676368124672 [Note] InnoDB: Read page 0 from tablespace for space 9 name test/AA key_id 0 encryption 0 h
      andle 44.
      2017-01-15  3:21:00 139676368124672 [Note] InnoDB: Read page 0 from tablespace for space 5 name test/B key_id 0 encryption 0 ha
      ndle 45.
      InnoDB: Error: trying to access page number 0 in space 5,
      InnoDB: space name test/B,
      InnoDB: which is outside the tablespace bounds.
      InnoDB: Byte offset 0, len 32768, i/o type 10.
      InnoDB: If you get this error at mysqld startup, please check that
      InnoDB: your my.cnf matches the ibdata files that you have in the
      InnoDB: MySQL server.
      2017-01-15 03:21:00 7f08f04e3b00  InnoDB: Assertion failure in thread 139676368124672 in file fil0fil.cc line 6109
      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.
      170115  3:21:00 [ERROR] mysqld got signal 6 ;
      

      #5  0x00007f08ecdda448 in __GI_abort () at abort.c:89
      #6  0x00007f08efc82f6e in _fil_io (type=10, sync=true, space_id=5, zip_size=0, block_offset=0, byte_offset=0, len=32768, buf=0x7f08e3dd0000, message=0x7f08dcb6e940, write_size=0x7f08dcb6e960, trx=0x0) at /data/src/10.1/storage/xtradb/fil/fil0fil.cc:6109
      #7  0x00007f08efc299b0 in buf_read_page_low (err=0x7f08f04df87c, sync=true, mode=132, space=5, zip_size=0, unzip=0, tablespace_version=8, offset=32, trx=0x0, rbpage=0x7f08f04df8e8) at /data/src/10.1/storage/xtradb/buf/buf0rea.cc:243
      #8  0x00007f08efc29eaa in buf_read_page (space=5, zip_size=0, offset=32, trx=0x0, bpage=0x7f08f04df8e8) at /data/src/10.1/storage/xtradb/buf/buf0rea.cc:474
      #9  0x00007f08efc06e9b in buf_page_get_gen (space=5, zip_size=0, offset=32, rw_latch=3, guess=0x0, mode=10, file=0x7f08f0074818 "/data/src/10.1/storage/xtradb/btr/btr0cur.cc", line=4276, mtr=0x7f08f04dfe90, err=0x7f08f04df9cc) at /data/src/10.1/storage/xtradb/buf/buf0buf.cc:3013
      #10 0x00007f08efbdb02a in btr_cur_open_at_rnd_pos_func (index=0x7f08cec60e78, latch_mode=1, cursor=0x7f08f04dfe10, file=0x7f08f0074818 "/data/src/10.1/storage/xtradb/btr/btr0cur.cc", line=4276, mtr=0x7f08f04dfe90) at /data/src/10.1/storage/xtradb/btr/btr0cur.cc:1162
      #11 0x00007f08efbe154a in btr_estimate_number_of_different_key_vals (index=0x7f08cec60e78) at /data/src/10.1/storage/xtradb/btr/btr0cur.cc:4276
      #12 0x00007f08efc6594d in dict_stats_update_transient_for_index (index=0x7f08cec60e78) at /data/src/10.1/storage/xtradb/dict/dict0stats.cc:923
      #13 0x00007f08efc65af3 in dict_stats_update_transient (table=0x7f08cec8fd78) at /data/src/10.1/storage/xtradb/dict/dict0stats.cc:982
      #14 0x00007f08efc6a4af in dict_stats_update (table=0x7f08cec8fd78, stats_upd_option=DICT_STATS_RECALC_TRANSIENT) at /data/src/10.1/storage/xtradb/dict/dict0stats.cc:3404
      #15 0x00007f08efa006cb in dict_stats_init (table=0x7f08cec8fd78) at /data/src/10.1/storage/xtradb/include/dict0stats.ic:174
      #16 0x00007f08efa07f4b in ha_innobase::open (this=0x7f08cecc3088, name=0x7f08ceca1160 "./test/B", mode=2, test_if_locked=18) at /data/src/10.1/storage/xtradb/handler/ha_innodb.cc:6465
      #17 0x00007f08ef818220 in handler::ha_open (this=0x7f08cecc3088, table_arg=0x7f08cece3a70, name=0x7f08ceca1160 "./test/B", mode=2, test_if_locked=18) at /data/src/10.1/sql/handler.cc:2501
      #18 0x00007f08ef6cbc3c in open_table_from_share (thd=0x7f08d8658070, share=0x7f08ceca0c88, alias=0x7f08cec43fe8 "B", db_stat=39, prgflag=44, ha_open_flags=18, outparam=0x7f08cece3a70, is_create_table=false) at /data/src/10.1/sql/table.cc:2929
      #19 0x00007f08ef573e86 in open_table (thd=0x7f08d8658070, table_list=0x7f08cec43ff0, ot_ctx=0x7f08f04e1970) at /data/src/10.1/sql/sql_base.cc:2552
      #20 0x00007f08ef5766e0 in open_and_process_table (thd=0x7f08d8658070, lex=0x7f08d865b9f0, tables=0x7f08cec43ff0, counter=0x7f08f04e1a2c, flags=0, prelocking_strategy=0x7f08f04e1a30, has_prelocking_list=false, ot_ctx=0x7f08f04e1970) at /data/src/10.1/sql/sql_base.cc:4067
      #21 0x00007f08ef57775b in open_tables (thd=0x7f08d8658070, options=..., start=0x7f08f04e1a10, counter=0x7f08f04e1a2c, flags=0, prelocking_strategy=0x7f08f04e1a30) at /data/src/10.1/sql/sql_base.cc:4578
      #22 0x00007f08ef5d3d00 in open_tables (thd=0x7f08d8658070, tables=0x7f08f04e1a10, counter=0x7f08f04e1a2c, flags=0, prelocking_strategy=0x7f08f04e1a30) at /data/src/10.1/sql/sql_base.h:251
      #23 0x00007f08ef5d9e43 in lock_tables_open_and_lock_tables (thd=0x7f08d8658070, tables=0x7f08cec43380) at /data/src/10.1/sql/sql_parse.cc:2329
      #24 0x00007f08ef5dfb00 in mysql_execute_command (thd=0x7f08d8658070) at /data/src/10.1/sql/sql_parse.cc:4364
      #25 0x00007f08ef5e8bb5 in mysql_parse (thd=0x7f08d8658070, rawbuf=0x7f08cec43088 "LOCK TABLES `A` READ /*!32311 LOCAL */,`AA` READ /*!32311 LOCAL */,`B` READ /*!32311 LOCAL */,`BB` READ /*!32311 LOCAL */,`C` READ /*!32311 LOCAL */,`CC` READ /*!32311 LOCAL */,`D` READ /*!32311 LOCAL"..., length=289, parser_state=0x7f08f04e25e0) at /data/src/10.1/sql/sql_parse.cc:7322
      #26 0x00007f08ef5d7bc2 in dispatch_command (command=COM_QUERY, thd=0x7f08d8658070, packet=0x7f08dc374071 "LOCK TABLES `A` READ /*!32311 LOCAL */,`AA` READ /*!32311 LOCAL */,`B` READ /*!32311 LOCAL */,`BB` READ /*!32311 LOCAL */,`C` READ /*!32311 LOCAL */,`CC` READ /*!32311 LOCAL */,`D` READ /*!32311 LOCAL"..., packet_length=289) at /data/src/10.1/sql/sql_parse.cc:1488
      #27 0x00007f08ef5d693b in do_command (thd=0x7f08d8658070) at /data/src/10.1/sql/sql_parse.cc:1109
      #28 0x00007f08ef70c820 in do_handle_one_connection (thd_arg=0x7f08d8658070) at /data/src/10.1/sql/sql_connect.cc:1350
      #29 0x00007f08ef70c584 in handle_one_connection (arg=0x7f08d8658070) at /data/src/10.1/sql/sql_connect.cc:1262
      #30 0x00007f08ef9ef996 in pfs_spawn_thread (arg=0x7f08dc33caf0) at /data/src/10.1/storage/perfschema/pfs.cc:1860
      #31 0x00007f08eecd40a4 in start_thread (arg=0x7f08f04e3b00) at pthread_create.c:309
      #32 0x00007f08ece8c87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

        Attachments

        1. B.ibd
          1.03 MB
        2. t7.test.gz
          2.26 MB

          Issue Links

            Activity

              People

              Assignee:
              jplindst Jan Lindström
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration