Skip to content

MySQL Data Dictionary in MyRocks: Limitations and Known Issues

luqun edited this page Mar 18, 2024 · 2 revisions
  • MyRocks only supports READ COMMITTED and REPEATABLE READ transaction isolation levels. However, some data dictionary operations are designed to use READ UNCOMMITTED. When running with the MyRocks data dictionary, the isolation level for these operations is upgraded to READ COMMITTED. Most of the time this is invisible for the user, but some operations, mostly involving foreign keys, may fail in surprising ways. For example,
    ALTER TABLE self DROP FOREIGN KEY c PARTITION BY KEY (pk) PARTITIONS 20;
        

    will succeed under InnoDB data dictionary and fail under MyRocks with an error:

    ERROR 1506 (HY000): Foreign keys are not yet supported in conjunction with partitioning
        

    The workaround is to split such operation into two.

  • A silent schema definition corruption with foreign keys is possible if an ALTER TABLE renames multiple tables in a single statement, where some of the involved tables end up swapping their names. Any foreign keys to such tables will end up pointing to an incorrect table. The workaround is to rename one table per ALTER TABLE statement.
  • Idempotent replica mode is incompatible with having both InnoDB and MyRocks tables in an instance, including DD tables.
  • Cloned instance rollback, which can happen if a cloned instance fixup action fails, is not supported and will result in a corrupted instance. Note that successful clone with multiple storage engines is still supported with MyRocks DDSE.
  • In debug builds, if skip_dd_table_access_check is enabled, ALTER TABLE operations on the DD table that involve temporary tables are not supported. The reason is that MyRocks handlerton does not support HTON_SUPPORTS_ATOMIC_DDL, thus does intermediate commits, observing inconsistent data dictionary.
  • In debug builds, using the debug-only variable innodb_purge_stop_now may result in deadlocks involving LOCK_global_system_variables. This is caused by ha_rocksdb::open accessing server system variables while already being called from the system variable modification path, as stopping InnoDB purge tries to access DD information for the InnoDB tables.
Clone this wiki locally