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

Assertion `!cache_list || cache_list->empty()' fails in online_alter_close_connection

    XMLWordPrintable

Details

    Description

      The test case is very non-deterministic, but it's remarkably well rr-able (it can take a few thousands attempts on my machine without rr, but usually fails in a few attempts with --rr=-h).
      Try to run with --repeat=N and --rr=-h.

      It looks like the failure started happening on 11.7 after the merge:

      commit b12ff287ecefef4213e4e24c4413e7c63ad1f84a 7aa28a2a546620bbcc066704f0e6cf2fc007de6d d8dad8c3b54cd09fefce7bc3b9749f427eed9709
      Merge: 7aa28a2a546 d8dad8c3b54
      Commit:     Oleksandr Byelkin <sanja@mariadb.com>
      CommitDate: Sun Nov 10 19:22:21 2024 +0100
       
          Merge branch '11.6' into 11.7
      

      However, I couldn't reproduce it on 11.6. Also, since the test case behaves generally differently without innnodb_snapshot_isolation, the commit enabling innnodb_snapshot_isolation by default seems a likely suspect, but the failure isn't reproducible on 11.7 before the merge above even with the explicit innnodb_snapshot_isolation=on. There weren't many other 11.6 changes in that merge, so possibly the difference comes from lower versions.

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      SET @isolation.save= @@global.innodb_snapshot_isolation;
      SET GLOBAL innodb_snapshot_isolation= ON;
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      CREATE TABLE t2 (col_char CHAR(224), id SERIAL) ENGINE=InnoDB;
      CREATE TABLE t3 (
       id int(10) unsigned NOT NULL auto_increment,
       c char(120) NOT NULL default '',
       PRIMARY KEY (id)) ENGINE=Aria;
      INSERT INTO t3 SELECT seq, CHR(seq%26+97) FROM seq_1_to_100;
       
      --connect (con1,localhost,root,,)
      --connect (con2,localhost,root,,)
      --connect (con3,localhost,root,,)
      XA BEGIN 'x1';
      INSERT INTO t2 () VALUES ();
       
      --connection con2
      XA START 'x2';
      SELECT * FROM t1;
      --error ER_CHECKREAD
      UPDATE t2 SET col_char = NULL;
       
      --connection con1
      --send
        ALTER TABLE t3 ADD KEY (c);
       
      --connection con2
      DELETE FROM t3 WHERE id = 0;
      UPDATE t3 SET c = '';
      --error ER_XA_RBROLLBACK
      XA END 'x2';
      XA ROLLBACK 'x2';
      --connection con1
      --reap
      --disconnect con1
      --disconnect con2
      --connection con3
      XA END 'x1';
      XA ROLLBACK 'x1';
      --disconnect con3
       
      --connection default
      DROP TABLE t1, t2, t3;
      SET GLOBAL innodb_snapshot_isolation= @isolation.save;
      

      2024-12-16 15:54:40 6 [Warning] WSREP: handlerton rollback failed, thd 6 48 conf 0 SQL XA ROLLBACK 'x2'
      mariadbd: /data/MDEV-35661/11.7/sql/online_alter.cc:426: int online_alter_close_connection(THD*): Assertion `!cache_list || cache_list->empty()' failed.
       
      #3  0x000048f350d11fd6 in __GI___assert_fail (assertion=0x55f6effd0a80 "!cache_list || cache_list->empty()", 
          file=0x55f6effd0810 "/data/MDEV-35661/11.7/sql/online_alter.cc", line=426, function=0x55f6effd0aa8 "int online_alter_close_connection(THD*)")
          at assert.c:101
      #4  0x000055f6ef4b9656 in online_alter_close_connection (thd=0x5abcfc000d48) at /data/MDEV-35661/11.7/sql/online_alter.cc:426
      #5  0x000055f6ef2a8023 in ha_close_connection (thd=0x5abcfc000d48) at /data/MDEV-35661/11.7/sql/handler.cc:967
      #6  0x000055f6eee3ad88 in THD::free_connection (this=0x5abcfc000d48) at /data/MDEV-35661/11.7/sql/sql_class.cc:1732
      #7  0x000055f6eed3c32e in unlink_thd (thd=0x5abcfc000d48) at /data/MDEV-35661/11.7/sql/mysqld.cc:2876
      #8  0x000055f6ef0944dc in do_handle_one_connection (connect=0x55f6f231e6f8, put_in_cache=true) at /data/MDEV-35661/11.7/sql/sql_connect.cc:1426
      #9  0x000055f6ef094211 in handle_one_connection (arg=0x55f6f231e6f8) at /data/MDEV-35661/11.7/sql/sql_connect.cc:1327
      #10 0x00005abd001f8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #11 0x000048f350dfd353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.