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

Unexpected ER_CRASHED_ON_USAGE and Assertion `limit >= trx_id' failed in purge_node_t::skip

    XMLWordPrintable

Details

    Description

      Notes:

      • In the test case below, the last ALTER returns ER_CRASHED_ON_USAGE. There is no good reason for this. It is masked in the test case so that we can get to the assertion failure as was requested. I am not sure whether the assertion failure and the corruption are the same bug; maybe the corruption needs to be filed separately.
      • I could only reproduce the assertion failure on 10.4. It currently happens very reliably for me on 10.4, but it's still a non-deterministic test case, run with --repeat if it doesn't fail. Probably it can be made deterministic with help of InnoDB debug injections (or even debug variables). The corruption errors are reproducible on 10.4+, although much older versions of 10.4; but not on 10.3.
      • Shutdown isn't needed for the failure to happen. I added it in the pursuit of better reproducibility.

      --source include/have_innodb.inc
      --source include/have_partition.inc
      --source include/have_sequence.inc
       
      call mtr.add_suppression("is marked as crashed and should be repaired");
      call mtr.add_suppression("user defined columns in InnoDB, but");
       
      CREATE TABLE t1 (a INT, UNIQUE USING HASH (a)) ENGINE=InnoDB
      PARTITION BY RANGE(a) (
        PARTITION p1 VALUES LESS THAN (2),
        PARTITION p2 VALUES LESS THAN (101)
      );
      INSERT INTO t1 SELECT seq FROM seq_1_to_100;
       
      ALTER TABLE t1 ADD PARTITION (PARTITION p3 VALUES LESS THAN (MAXVALUE));
       
      --error ER_CRASHED_ON_USAGE
      ALTER TABLE t1 FORCE;
       
      --source include/restart_mysqld.inc
       
      DROP TABLE t1;
      

      10.4 b2bb747f

      2021-05-11 19:32:02 9 [Warning] InnoDB: Table test/t1#P#p1 contains 2 user defined columns in InnoDB, but 1 columns in MariaDB. Please check INFORMATION_SCHEMA.INNODB_SYS_COLUMNS and https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
      2021-05-11 19:32:02 9 [ERROR] mysqld: Table 't1' is marked as crashed and should be repaired
      2021-05-11 19:32:02 0 [Note] /mnt-hd8t/bld/10.4-debug-nightly/bin/mysqld (initiated by: root[root] @ localhost []): Normal shutdown
      2021-05-11 19:32:02 0 [Note] InnoDB: FTS optimize thread exiting.
      2021-05-11 19:32:02 0 [Note] Event Scheduler: Purging the queue. 0 events
      mysqld: /data/src/10.4/storage/innobase/include/row0purge.h:175: void purge_node_t::skip(table_id_t, trx_id_t): Assertion `limit >= trx_id' failed.
      210511 19:32:02 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f4593444f36 in __GI___assert_fail (assertion=0x563c26a90b5e "limit >= trx_id", file=0x563c26a90b70 "/data/src/10.4/storage/innobase/include/row0purge.h", line=175, function=0x563c26a90ba8 "void purge_node_t::skip(table_id_t, trx_id_t)") at assert.c:101
      #8  0x0000563c262a1d84 in purge_node_t::skip (this=0x563c29ba9250, id=20, limit=33) at /data/src/10.4/storage/innobase/include/row0purge.h:175
      #9  0x0000563c262a03a7 in row_purge_parse_undo_rec (node=0x563c29ba9250, undo_rec=0x563c29ba97f0 "", updated_extern=0x7f456f7fdcfe, thr=0x563c29ba9080) at /data/src/10.4/storage/innobase/row/row0purge.cc:1134
      #10 0x0000563c262a0ad1 in row_purge (node=0x563c29ba9250, undo_rec=0x563c29ba97f0 "", thr=0x563c29ba9080) at /data/src/10.4/storage/innobase/row/row0purge.cc:1261
      #11 0x0000563c262a0e9c in row_purge_step (thr=0x563c29ba9080) at /data/src/10.4/storage/innobase/row/row0purge.cc:1342
      #12 0x0000563c26209504 in que_thr_step (thr=0x563c29ba9080) at /data/src/10.4/storage/innobase/que/que0que.cc:1038
      #13 0x0000563c2620979c in que_run_threads_low (thr=0x563c29ba9080) at /data/src/10.4/storage/innobase/que/que0que.cc:1100
      #14 0x0000563c26209a02 in que_run_threads (thr=0x563c29ba9080) at /data/src/10.4/storage/innobase/que/que0que.cc:1140
      #15 0x0000563c262eafcc in srv_task_execute (slot=0x563c270b5ec0 <srv_sys+832>) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2465
      #16 0x0000563c262eb261 in srv_worker_thread (arg=0x0) at /data/src/10.4/storage/innobase/srv/srv0srv.cc:2520
      #17 0x00007f459395c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x00007f4593530293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

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