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

InnoDB: tried to purge non-delete-marked record, assertion fails in row_purge_del_mark_error

    XMLWordPrintable

Details

    • Q2/2026 Server Maintenance

    Description

      Note on the use of innodb_max_purge_lag_wait in the test case: it is not an essential part of the test, but we need to have a purge there, and it seems to be doing the trick. Originally the test case had "sleep 6", it was also working, just slower.

      --source include/have_partition.inc
      --source include/have_innodb.inc
       
      SET @innodb_max_purge_lag_wait.save = @@innodb_max_purge_lag_wait;
       
      SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
       
      CREATE TABLE t (
        pk INT AUTO_INCREMENT,
        a INT DEFAULT 0,
        b INT DEFAULT 0,
        c BLOB DEFAULT 0,
        KEY (a),
        PRIMARY KEY (pk),
        UNIQUE (b,c)
        ) ENGINE=InnoDB PARTITION BY KEY (pk) PARTITIONS 2;
      INSERT IGNORE INTO t (b,c) VALUES (0,0),(0,0);
      UPDATE t SET c = 1;
      INSERT INTO t (b,c) VALUES (0,0);
      UPDATE t SET a = 2;
       
      SET GLOBAL innodb_max_purge_lag_wait = 0;
       
      # Cleanup
      DROP TABLE t;
      SET GLOBAL innodb_max_purge_lag_wait = @innodb_max_purge_lag_wait.save;
      

      11.4 1abec9a9f8f660abf3a6d6177a49f4c2fe628fa8

      2026-03-17 11:22:22 0 [ERROR] InnoDB: tried to purge non-delete-marked record in index `b` of table `test`.`t` /* Partition `p1` */: tuple: TUPLE (info_bits=0, 2 fields): {[8]       1(0x0000000000000431),[4]    (0x80000002)}, record: COMPACT RECORD(info_bits=0, 2 fields): {[8]       1(0x0000000000000431),[4]    (0x80000002)}
      mariadbd: /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:771: void row_purge_del_mark_error(const btr_cur_t&, const dtuple_t&): Assertion `0' failed.
      260317 11:22:22 [ERROR] /share8t/bld/11.4-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #10 0x00007f3f9ee53eb2 in __GI___assert_fail (assertion=0x556d77eff4e0 "0", file=0x556d77f011e0 "/data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc", line=771, function=0x556d77eff520 "void row_purge_del_mark_error(const btr_cur_t&, const dtuple_t&)") at ./assert/assert.c:101
      #11 0x0000556d76a25b89 in row_purge_del_mark_error (cursor=..., entry=...) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:771
      #12 0x0000556d76a2704d in row_purge_remove_sec_if_poss_leaf (node=node@entry=0x623000005bc8, index=index@entry=0x6160009a6f20, entry=entry@entry=0x61a00006fd20) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:924
      #13 0x0000556d76a2786f in row_purge_remove_sec_if_poss (node=node@entry=0x623000005bc8, index=index@entry=0x6160009a6f20, entry=entry@entry=0x61a00006fd20) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:981
      #14 0x0000556d76a28abd in row_purge_del_mark (node=node@entry=0x623000005bc8) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:1013
      #15 0x0000556d76a2939d in row_purge_record (node=node@entry=0x623000005bc8, undo_rec=undo_rec@entry=0x773f95d0c14e "\001\207\016\002\023", thr=thr@entry=0x623000005b20, updated_extern=<optimized out>) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:1430
      #16 0x0000556d76a2aae3 in row_purge (node=node@entry=0x623000005bc8, undo_rec=undo_rec@entry=0x773f95d0c14e "\001\207\016\002\023", thr=thr@entry=0x623000005b20) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:1481
      #17 0x0000556d76a2ac37 in row_purge_step (thr=thr@entry=0x623000005b20) at /data/bld/11.4-asan-ubsan/storage/innobase/row/row0purge.cc:1544
      #18 0x0000556d76892831 in que_thr_step (thr=thr@entry=0x623000005b20) at /data/bld/11.4-asan-ubsan/storage/innobase/que/que0que.cc:553
      #19 0x0000556d76892aff in que_run_threads_low (thr=thr@entry=0x623000005b20) at /data/bld/11.4-asan-ubsan/storage/innobase/que/que0que.cc:609
      #20 0x0000556d76892e0c in que_run_threads (thr=thr@entry=0x623000005b20) at /data/bld/11.4-asan-ubsan/storage/innobase/que/que0que.cc:629
      #21 0x0000556d76aea04b in srv_task_execute (thd=thd@entry=0x62c000098218) at /data/bld/11.4-asan-ubsan/storage/innobase/srv/srv0srv.cc:1356
      #22 0x0000556d76aea236 in srv_purge_worker_task_low () at /data/bld/11.4-asan-ubsan/storage/innobase/srv/srv0srv.cc:1488
      #23 0x0000556d76aeb863 in purge_worker_callback () at /data/bld/11.4-asan-ubsan/storage/innobase/srv/srv0srv.cc:1502
      #24 0x0000556d770b2085 in tpool::task_group::execute (this=this@entry=0x556d819beaa0 <purge_task_group>, t=t@entry=0x556d819be9e0 <purge_worker_task>) at /data/bld/11.4-asan-ubsan/tpool/task_group.cc:70
      #25 0x0000556d770b24cb in tpool::task::execute (this=0x556d819be9e0 <purge_worker_task>) at /data/bld/11.4-asan-ubsan/tpool/task.cc:32
      #26 0x0000556d7709ea54 in tpool::thread_pool_generic::worker_main (this=0x61900001bd80, thread_var=0x6320000188a0) at /data/bld/11.4-asan-ubsan/tpool/tpool_generic.cc:568
      #27 0x0000556d770b06b7 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__f=@0x604000002028: (void (tpool::thread_pool_generic::*)(tpool::thread_pool_generic * const, tpool::worker_data *)) 0x556d7709e798 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __t=@0x604000002020: 0x61900001bd80) at /usr/include/c++/12/bits/invoke.h:74
      #28 0x0000556d770b0862 in std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=@0x604000002028: (void (tpool::thread_pool_generic::*)(tpool::thread_pool_generic * const, tpool::worker_data *)) 0x556d7709e798 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>) at /usr/include/c++/12/bits/invoke.h:90
      #29 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=0x604000002018) at /usr/include/c++/12/bits/std_thread.h:252
      #30 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=0x604000002018) at /usr/include/c++/12/bits/std_thread.h:259
      #31 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=0x604000002010) at /usr/include/c++/12/bits/std_thread.h:210
      #32 0x00007f3f9f8d44a3 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #33 0x00007f3f9eea81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #34 0x00007f3f9ef2885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The assertion failure belongs to a debug build, the corruption-like error occurs on a non-debug build as well.

      The failure started happening after this commit in 11.4:

      commit a4e4a56720c974b547d4e469a8c54510318bc2c9
      Commit:     Kristian Nielsen
      CommitDate: Wed Mar 11 15:42:41 2026 +0100
       
          MDEV-38734: Virtual columns wrongly included in binlog_row_image=MINIMAL
      

      Attachments

        Issue Links

          Activity

            People

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