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

Slave index corruption: InnoDB: Record in index was not found on update/rollback: TUPLE ... at: COMPACT RECORD

    XMLWordPrintable

Details

    Description

      # Requires standard m/s replication. Use RBR or MBR.
      SET binlog_row_image='NOBLOB';
      CREATE TABLE t (c INT PRIMARY KEY, d INT, i BLOB GENERATED ALWAYS AS (c), KEY k(i)) ENGINE=InnoDB;
      CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
      INSERT INTO t (c) VALUES (1); 
      SELECT * FROM performance_schema.global_status;
      UPDATE t SET d=0;
      

      Leads to:

      10.6.18 33af5575a976c86163752cce77dddb640ffeef00 (Optimized, Slave)

      2024-04-23 10:31:44 6 [ERROR] InnoDB: Record in index `k` of table `test`.`t` was not found on update: TUPLE (info_bits=0, 2 fields): {NULL,[4]    (0x80000001)} at: COMPACT RECORD(info_bits=0, 1 fields): {[8]infimum (0x696E66696D756D00)}
      2024-04-23 10:31:44 6 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mariadbd server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
      2024-04-23 10:31:44 6 [Warning] InnoDB: Record in index `k` of table `test`.`t` was not found on rollback, trying to insert: TUPLE (info_bits=0, 2 fields): {NULL,[4]    (0x80000001)} at: COMPACT RECORD(info_bits=0, 1 fields): {[8]infimum (0x696E66696D756D00)}
      2024-04-23 10:31:44 6 [ERROR] mariadbd: Index for table 't' is corrupt; try to repair it
      2024-04-23 10:31:44 6 [ERROR] Slave SQL: Could not execute Update_rows_v1 event on table test.t; Index for table 't' is corrupt; try to repair it, Error_code: 1034; handler error HA_ERR_CRASHED; the event's master log binlog.000001, end_log_pos 1595, Gtid 0-1-7, Internal MariaDB error code: 1034
      2024-04-23 10:31:44 6 [Warning] Slave: Index for table 't' is corrupt; try to repair it Error_code: 1034
      2024-04-23 10:31:44 6 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'binlog.000001' position 1416; GTID position '0-1-6'
      

      May seem lightly sporadic, but is more likely timing-based (i.e. SLEEP's etc. may help to reduce any light sporadicity).
      Both dbg+opt affected. PS required. The specific PS table queried does not seem to matter.
      The issue has been reproduced in the versions listed above, but not in 11.4, 11.5.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              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.