What does the Key reference in MySQL sdi_delete failed message?



  • I am trying to run this query on a MySQL database:

    alter table table_name alter column_name set default 6160

    The console tells me:

    Failed to delete sdi for database_name.table_name in database_name/table_name due to missing record.

    The MySQL error.log file tells me:

    [InnoDB] sdi_delete failed: Record Doesn't exist: tablespace_id: 111111 Key: 1 222222

    Note that the ID of 111111 and Key 222222 here are made up. There is a 1 after "Key:" and before 222222 though.

    So I figured out I can find out the table it's referring to, using this query:

    select * from information_schema.INNODB_TABLESPACES_BRIEF where space = 111111

    And sure enough, the result gives me database_name/table_name as the first error message says.

    But there are no constraints on this table other than the primary key. And there are not 6-figures worth of rows in it, so the key it's printing out can't refer to a value in the id column in my table.

    What is Key: 1 222222 referring to? How can I find out which specific record it's referring to?



  • The SDI key is not referring to anything in your table; it's the key of the https://dev.mysql.com/doc/refman/8.0/en/serialized-dictionary-information.html record for the table itself. SDI is new for MySQL 8, so if your table(space) was created by an earlier version, the record would not exist (and would probably be created after a successful DDL statement against the table).

    If it existed, you would be able to use the https://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html to retrieve the table information by passing it the --type (1) and --id (222222) of the record.


    The meaning of fields in the warning message can be gleaned from the https://github.com/mysql/mysql-server/blob/6846e6b2f72931991cc9fd589dc9946ea2ab58c9/storage/innobase/api/api0api.cc#L3167 :

          ib::warn(ER_IB_MSG_11) << "sdi_delete failed: Record Doesn't exist:"
                                 << " tablespace_id: " << tablespace_id
                                 << " Key: " << ib_sdi_key->sdi_key->type << " "
                                 << ib_sdi_key->sdi_key->id;
          // Emit warning, and report missing record error, but do not
          // assert since this situation can occur when upgrading from a
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2