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

Assertion `!srv_safe_truncate || !newest_lsn || fil_page_get_type(page)' or `!newest_lsn || fil_page_get_type(page)' failed in buf_flush_init_for_writing

    XMLWordPrintable

Details

    Description

      Notes:
      The failure is not related to the weird column names in the test case, but it is related to the length of the names, and I don't want to invent more natural-looking long names.
      The test case uses scrubbing, I have no information whether it's strictly necessary for the failure to happen, or it is only needed for this test case.

      --source include/have_innodb.inc
       
      SET GLOBAL innodb_immediate_scrub_data_uncompressed=ON;
       
      CREATE TABLE t1 (
          pk int,
          a bigint,
          b bigint unsigned,
          c timestamp NULL DEFAULT 0,
          d varchar(257) CHARACTER SET latin1,
          e varchar(257) CHARACTER SET utf8,
          f tinyint,
          g varchar(257) CHARACTER SET binary,
          h tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t2 (
          pk int,
          a bigint,
          b bigint unsigned,
          c timestamp NULL DEFAULT 0,
          d varchar(257) CHARACTER SET latin1,
          e varchar(257) CHARACTER SET utf8,
          f tinyint,
          g varchar(257) CHARACTER SET binary,
          h tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t3 (
          pk int auto_increment,
          a varchar(257) CHARACTER SET utf8,
          b varchar(257) CHARACTER SET binary,
          c timestamp NULL DEFAULT 0,
          d bigint unsigned,
          e varchar(257) CHARACTER SET latin1,
          f tinyint,
          g tinyint unsigned,
          h bigint,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t4 (
          pk int,
          a bigint,
          b bigint unsigned,
          c timestamp NULL DEFAULT 0,
          d varchar(257) CHARACTER SET latin1,
          e varchar(257) CHARACTER SET utf8,
          f tinyint,
          g varchar(257) CHARACTER SET binary,
          h tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t5 (
          pk int,
          a bigint,
          b bigint unsigned,
          c timestamp NULL DEFAULT 0,
          d varchar(257) CHARACTER SET latin1,
          e varchar(257) CHARACTER SET utf8,
          f tinyint,
          g varchar(257) CHARACTER SET binary,
          h tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t6 (
          pk int,
          a bigint,
          b bigint unsigned,
          c timestamp NULL DEFAULT 0,
          d varchar(257) CHARACTER SET latin1,
          e varchar(257) CHARACTER SET utf8,
          f tinyint,
          g varchar(257) CHARACTER SET binary,
          h tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t7 (
          pk int,
          a bigint,
          b bigint unsigned,
          c timestamp NULL DEFAULT 0,
          d varchar(257) CHARACTER SET latin1,
          e varchar(257) CHARACTER SET utf8,
          f tinyint,
          g_________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t8 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t9 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t10 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t11 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t12 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t13 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t14 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t15 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t16 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t17 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t18 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t19 (
          pk int,
          a_____________________ bigint,
          b_____________________ bigint unsigned,
          c_____________________ timestamp NULL DEFAULT 0,
          d_____________________ varchar(257) CHARACTER SET latin1,
          e_____________________ varchar(257) CHARACTER SET utf8,
          f_____________________ tinyint,
          g_____________________ varchar(257) CHARACTER SET binary,
          h_____________________ tinyint unsigned,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t20 (
          pk int auto_increment,
          a___________________ varchar(257) CHARACTER SET utf8,
          b_________ bigint,
          c__________ tinyint,
          d____________ timestamp NULL DEFAULT 0,
          e__________________ bigint unsigned,
          f___________________ tinyint unsigned,
          g_____________________ varchar(257) CHARACTER SET latin1,
          h_______________________ varchar(257) CHARACTER SET binary,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE TABLE t21 (
          pk int,
          a_____________________ varchar(257) CHARACTER SET binary,
          b___________________ varchar(257) CHARACTER SET utf8,
          c_________ bigint,
          d____________ timestamp NULL DEFAULT 0,
          e___________________ tinyint unsigned,
          f__________________ bigint unsigned,
          g_____________________ varchar(257) CHARACTER SET latin1,
          h__________ tinyint,
          primary key (pk)
      ) ENGINE=InnoDB;
       
      CREATE OR REPLACE TABLE t13 (a VARBINARY(290) DEFAULT '') ENGINE=InnoDB;
       
      --source include/restart_mysqld.inc
       
      # Cleanup
      DROP TABLE IF EXISTS t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21;
      

      10.2 4ca0abe9

      2019-10-12 14:43:20 140683148736256 [Note] InnoDB: Starting shutdown...
      2019-10-12 14:43:20 140682576516864 [Note] InnoDB: Dumping buffer pool(s) to /dev/shm/var_auto_hxN6/mysqld.1/data/ib_buffer_pool
      2019-10-12 14:43:20 140682576516864 [Note] InnoDB: Instance 0, restricted to 128 pages due to innodb_buf_pool_dump_pct=25
      2019-10-12 14:43:20 140682576516864 [Note] InnoDB: Buffer pool(s) dump completed at 191012 14:43:20
      mysqld: /data/src/10.2/storage/innobase/buf/buf0flu.cc:859: void buf_flush_init_for_writing(const buf_block_t*, byte*, void*, lsn_t): Assertion `!srv_safe_truncate || !newest_lsn || fil_page_get_type(page)' failed.
      191012 14:43:21 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ff35ebb0f12 in __GI___assert_fail (assertion=0x560f10b97130 "!srv_safe_truncate || !newest_lsn || fil_page_get_type(page)", file=0x560f10b96c28 "/data/src/10.2/storage/innobase/buf/buf0flu.cc", line=859, function=0x560f10b98860 <buf_flush_init_for_writing(buf_block_t const*, unsigned char*, void*, unsigned long)::__PRETTY_FUNCTION__> "void buf_flush_init_for_writing(const buf_block_t*, byte*, void*, lsn_t)") at assert.c:101
      #8  0x0000560f10617758 in buf_flush_init_for_writing (block=0x7ff3594e3e70, page=0x7ff359b54000 "", page_zip_=0x0, newest_lsn=1754532) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:859
      #9  0x0000560f1061816f in buf_flush_write_block_low (bpage=0x7ff3594e3e70, flush_type=BUF_FLUSH_LIST, sync=false) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:1080
      #10 0x0000560f106188a6 in buf_flush_page (buf_pool=0x560f13354920, bpage=0x7ff3594e3e70, flush_type=BUF_FLUSH_LIST, sync=false) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:1252
      #11 0x0000560f106190f2 in buf_flush_try_neighbors (page_id=..., flush_type=BUF_FLUSH_LIST, n_flushed=261, n_to_flush=18446744073709551614) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:1475
      #12 0x0000560f10619433 in buf_flush_page_and_try_neighbors (bpage=0x7ff3594e3e70, flush_type=BUF_FLUSH_LIST, n_to_flush=18446744073709551614, count=0x7ff3517f99e8) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:1547
      #13 0x0000560f10619f25 in buf_do_flush_list_batch (buf_pool=0x560f13354920, min_n=18446744073709551614, lsn_limit=18446744073709551615) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:1806
      #14 0x0000560f1061a3c1 in buf_flush_batch (buf_pool=0x560f13354920, flush_type=BUF_FLUSH_LIST, min_n=18446744073709551614, lsn_limit=18446744073709551615, n=0x7ff3517f9c90) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:1875
      #15 0x0000560f1061aa71 in buf_flush_do_batch (buf_pool=0x560f13354920, type=BUF_FLUSH_LIST, min_n=18446744073709551614, lsn_limit=18446744073709551615, n=0x7ff3517f9c90) at /data/src/10.2/storage/innobase/buf/buf0flu.cc:2045
      #16 0x0000560f1061d313 in pc_flush_slot () at /data/src/10.2/storage/innobase/buf/buf0flu.cc:2853
      #17 0x0000560f1061e711 in buf_flush_page_cleaner_coordinator () at /data/src/10.2/storage/innobase/buf/buf0flu.cc:3364
      #18 0x00007ff3607264a4 in start_thread (arg=0x7ff3517fa700) at pthread_create.c:456
      #19 0x00007ff35ec6dd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      The failure appeared in 10.2 tree after this merge, but I couldn't reproduce it on the latest 10.1:

      commit 966d97b5f9ff8673fdb1da0ce6ad51a72b62afc4
      Merge: 1fd1ef25c25 c0c003beb48
      Author: Marko Mäkelä
      Date:   Fri Oct 11 18:38:18 2019 +0300
       
          Merge 10.1 into 10.2
      

      10.3 8e3d85e1

      mysqld: /data/src/10.3/storage/innobase/buf/buf0flu.cc:860: void buf_flush_init_for_writing(const buf_block_t*, byte*, void*, lsn_t): Assertion `!newest_lsn || fil_page_get_type(page)' failed.
      191012 14:53:33 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f2e0746cf12 in __GI___assert_fail (assertion=0x564d97ac50f0 "!newest_lsn || fil_page_get_type(page)", file=0x564d97ac4c28 "/data/src/10.3/storage/innobase/buf/buf0flu.cc", line=860, function=0x564d97ac68a0 <buf_flush_init_for_writing(buf_block_t const*, unsigned char*, void*, unsigned long)::__PRETTY_FUNCTION__> "void buf_flush_init_for_writing(const buf_block_t*, byte*, void*, lsn_t)") at assert.c:101
      #8  0x0000564d97423f3c in buf_flush_init_for_writing (block=0x7f2e00aee0e0, page=0x7f2e01148000 "", page_zip_=0x0, newest_lsn=1768116) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:860
      #9  0x0000564d97424d56 in buf_flush_write_block_low (bpage=0x7f2e00aee0e0, flush_type=BUF_FLUSH_LIST, sync=false) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:1082
      #10 0x0000564d974258ed in buf_flush_page (buf_pool=0x564d995f7a10, bpage=0x7f2e00aee0e0, flush_type=BUF_FLUSH_LIST, sync=false) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:1254
      #11 0x0000564d97426333 in buf_flush_try_neighbors (page_id=..., flush_type=BUF_FLUSH_LIST, n_flushed=261, n_to_flush=18446744073709551614) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:1477
      #12 0x0000564d974266b7 in buf_flush_page_and_try_neighbors (bpage=0x7f2e00aee0e0, flush_type=BUF_FLUSH_LIST, n_to_flush=18446744073709551614, count=0x7f2df8ff89d8) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:1549
      #13 0x0000564d974274a0 in buf_do_flush_list_batch (buf_pool=0x564d995f7a10, min_n=18446744073709551614, lsn_limit=18446744073709551615) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:1808
      #14 0x0000564d97427b1b in buf_flush_batch (buf_pool=0x564d995f7a10, flush_type=BUF_FLUSH_LIST, min_n=18446744073709551614, lsn_limit=18446744073709551615, n=0x7f2df8ff8c90) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:1878
      #15 0x0000564d974282f5 in buf_flush_do_batch (buf_pool=0x564d995f7a10, type=BUF_FLUSH_LIST, min_n=18446744073709551614, lsn_limit=18446744073709551615, n=0x7f2df8ff8c90) at /data/src/10.3/storage/innobase/buf/buf0flu.cc:2036
      #16 0x0000564d9742b108 in pc_flush_slot () at /data/src/10.3/storage/innobase/buf/buf0flu.cc:2835
      #17 0x0000564d9742c737 in buf_flush_page_cleaner_coordinator () at /data/src/10.3/storage/innobase/buf/buf0flu.cc:3339
      #18 0x00007f2e08fe24a4 in start_thread (arg=0x7f2df8ff9700) at pthread_create.c:456
      #19 0x00007f2e07529d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.