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

REPAIR does not fix MyISAM table with vector key after crash recovery

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 11.7.1
    • Vector search
    • None

    Description

      After a crash recovery, the vector key on a MyISAM table remains corrupt, CHECK doesn't detect it and REPAIR doesn't fix it (or at least I couldn't find the way to detect/fix it by the means of CHECK/REPAIR: EXTENDED or FORCE doesn't repair it, and USE_FRM destroys it, which may be a separate issue).

      CREATE TABLE t (v VECTOR(1) NOT NULL, VECTOR(v)) ENGINE=MyISAM;
      INSERT INTO t (v) VALUES (0x30303030),(0x31313131);
      --let $shutdown_timeout=0
      --source include/restart_mysqld.inc
      CHECK TABLE t EXTENDED;
      REPAIR TABLE t EXTENDED;
      CHECK TABLE t EXTENDED;
      SELECT v FROM t ORDER BY VEC_DISTANCE_EUCLIDEAN(0x323233232,v) LIMIT 1;
       
      # Cleanup
      DROP TABLE t;
      

      bb-11.6-MDEV-32887-vector c29016301f7095ccc482fdfec1887f61e5adbed1

      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	warning	1 client is using or hasn't closed the table properly
      test.t	check	status	OK
      REPAIR TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	repair	status	OK
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	status	OK
      SELECT v FROM t ORDER BY VEC_DISTANCE_EUCLIDEAN(0x323233232,v) LIMIT 1;
      bug.w2                                   [ fail ]
              Test ended at 2024-10-21 18:28:29
       
      CURRENT_TEST: bug.w2
      mysqltest: At line 8: query 'SELECT v FROM t ORDER BY VEC_DISTANCE_EUCLIDEAN(0x323233232,v) LIMIT 1' failed: HA_ERR_CRASHED_ON_USAGE (145): Table './test/t#i#00' is marked as crashed and should be repaired
      

      2024-10-21 18:28:29 3 [ERROR] mariadbd: Table './test/t#i#00' is marked as crashed and should be repaired
      2024-10-21 18:28:29 3 [ERROR] Got error 126 when reading table './test/t'
      2024-10-21 18:28:29 3 [ERROR] mariadbd: Index for table 't' is corrupt; try to repair it
      

      Rebuilding table by ALTER helps.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.