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

Assertion !recv_no_ibuf_operations failed in ibuf_page_low()

    XMLWordPrintable

    Details

      Description

      In a 10.5 tree, we got ut_ad(!recv_no_ibuf_operations) failing during startup:

      #3  0x00005cd70c7c1f36 in __GI___assert_fail (assertion=0x564aece01e00 "!recv_no_ibuf_operations", 
          file=0x564aece010e0 "/Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc", line=968, 
          function=0x564aece01e40 "bool ibuf_page_low(page_id_t, ulint, bool, const char*, unsigned int, mtr_t*)") at assert.c:101
      #4  0x0000564aeb550450 in ibuf_page_low (page_id=..., zip_size=0, x_latch=false, 
          file=0x564aece010e0 "/Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc", line=4157, mtr=0x0)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc:968
      #5  0x0000564aeba1f76a in buf_page_get_low (page_id=..., zip_size=0, rw_latch=2, guess=0x0, mode=10, 
          file=0x564aece010e0 "/Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc", line=4157, mtr=0x7ffc791e47e0, err=0x7ffc791e46f0, 
          allow_ibuf_merge=false) at /Server/bb-10.5-MDEV-24693/storage/innobase/buf/buf0buf.cc:2946
      #6  0x0000564aeba219ba in buf_page_get_gen (page_id=..., zip_size=0, rw_latch=2, guess=0x0, mode=10, 
          file=0x564aece010e0 "/Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc", line=4157, mtr=0x7ffc791e47e0, err=0x7ffc791e46f0, 
          allow_ibuf_merge=false) at /Server/bb-10.5-MDEV-24693/storage/innobase/buf/buf0buf.cc:3479
      #7  0x0000564aeb54f489 in ibuf_bitmap_get_map_page_func (page_id=..., zip_size=0, 
          file=0x564aece010e0 "/Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc", line=4157, mtr=0x7ffc791e47e0)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc:694
      #8  0x0000564aeb561049 in ibuf_page_exists (id=..., zip_size=0) at /Server/bb-10.5-MDEV-24693/storage/innobase/ibuf/ibuf0ibuf.cc:4157
      #9  0x0000564aeba216bf in buf_page_get_gen (page_id=..., zip_size=0, rw_latch=1, guess=0x0, mode=10, 
          file=0x564aed127ec0 "/Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc", line=3141, mtr=0x7ffc791e65b0, err=0x7ffc791e50d0, 
          allow_ibuf_merge=true) at /Server/bb-10.5-MDEV-24693/storage/innobase/buf/buf0buf.cc:3458
      #10 0x0000564aeb9b0b07 in btr_cur_search_to_nth_level_func (index=0x6170000051a0, level=0, tuple=0x6140000058e0, mode=PAGE_CUR_GE, latch_mode=1, 
          cursor=0x7ffc791e6470, ahi_latch=0x0, file=0x564aed127ec0 "/Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc", line=3141, 
          mtr=0x7ffc791e65b0, autoinc=0) at /Server/bb-10.5-MDEV-24693/storage/innobase/btr/btr0cur.cc:1609
      #11 0x0000564aeb9e6096 in btr_pcur_open_low (index=0x6170000051a0, level=0, tuple=0x6140000058e0, mode=PAGE_CUR_GE, latch_mode=1, 
          cursor=0x7ffc791e6470, file=0x564aed127ec0 "/Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc", line=3141, autoinc=0, 
          mtr=0x7ffc791e65b0) at /Server/bb-10.5-MDEV-24693/storage/innobase/include/btr0pcur.ic:441
      #12 0x0000564aeb9ea853 in btr_pcur_open_on_user_rec_func (index=0x6170000051a0, tuple=0x6140000058e0, mode=PAGE_CUR_GE, latch_mode=1, 
          cursor=0x7ffc791e6470, file=0x564aed127ec0 "/Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc", line=3141, mtr=0x7ffc791e65b0)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/btr/btr0pcur.cc:652
      #13 0x0000564aebaebf09 in dict_load_table_on_id (table_id=1300, ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc:3141
      #12 0x0000564aeb9ea853 in btr_pcur_open_on_user_rec_func (index=0x6170000051a0, tuple=0x6140000058e0, mode=PAGE_CUR_GE, latch_mode=1, 
          cursor=0x7ffc791e6470, file=0x564aed127ec0 "/Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc", line=3141, mtr=0x7ffc791e65b0)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/btr/btr0pcur.cc:652
      #13 0x0000564aebaebf09 in dict_load_table_on_id (table_id=1300, ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0load.cc:3141
      #14 0x0000564aebaa929e in dict_table_open_on_id_low (table_id=1300, ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK, cached_only=false)
      --Type <RET> for more, q to quit, c to continue without paging--
          at /Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0dict.cc:222
      #15 0x0000564aebaabcb6 in dict_table_open_on_id (table_id=1300, dict_locked=false, table_op=DICT_TABLE_OP_LOAD_TABLESPACE, thd=0x0, mdl=0x0)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/dict/dict0dict.cc:948
      #16 0x0000564aeb91ed52 in trx_resurrect_table_locks (trx=0x7daf620f69b8, undo=0x6120000277d8)
          at /Server/bb-10.5-MDEV-24693/storage/innobase/trx/trx0trx.cc:615
      #17 0x0000564aeb91ff4c in trx_resurrect (undo=0x6120000277d8, rseg=0x613000006418, start_time=1611693453, start_time_micro=1079325810688, 
          rows_to_undo=0x7ffc791e78c0, is_old_insert=false) at /Server/bb-10.5-MDEV-24693/storage/innobase/trx/trx0trx.cc:711
      #18 0x0000564aeb920673 in trx_lists_init_at_db_start () at /Server/bb-10.5-MDEV-24693/storage/innobase/trx/trx0trx.cc:772
      #19 0x0000564aeb873542 in srv_start (create_new_db=false) at /Server/bb-10.5-MDEV-24693/storage/innobase/srv/srv0start.cc:1479
      #20 0x0000564aeb3cd78d in innodb_init (p=0x615000002b18) at /Server/bb-10.5-MDEV-24693/storage/innobase/handler/ha_innodb.cc:3909
      

      Thirunarayanan Balathandayuthapani pointed out that this is not a sign of a real problem, because at the time when recv_recovery_from_checkpoint_start() returned to this thread, the last-but-one recovery batches had already been completed and writes to the redo log had been enabled. The problem merely is that we were missing the opportunity to clear this flag:

      diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
      index 95179ec2271..f8b2cb95a3e 100644
      --- a/storage/innobase/log/log0recv.cc
      +++ b/storage/innobase/log/log0recv.cc
      @@ -4001,6 +4001,7 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
       	mutex_enter(&recv_sys->mutex);
       
       	recv_sys->apply_log_recs = TRUE;
      +	recv_no_ibuf_operations = is_mariabackup_restore_or_export();
       
       	mutex_exit(&recv_sys->mutex);
       
      

      This omission may have caused some corruption (MDEV-9663), because we could wrongly skip some change buffer merges:

      		if (!access_time && !recv_no_ibuf_operations) {
      			ibuf_merge_or_delete_for_page(
      				block, page_id, page_size);
      		}
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: