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

Purge of indexed virtual columns may cause hang on table-rebuilding DDL

    Details

      Description

      When a table is renamed to an internal #sql2 or #sql-ib name during a table-rebuilding DDL operation such as OPTIMIZE TABLE or ALTER TABLE, and shortly after that a purge operation in an index on virtual columns is attempted, the operation could fail, but purge would fail to release the table reference:

      diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
      index c3a6bd663b3..35e091e0f11 100644
      --- a/storage/innobase/handler/ha_innodb.cc
      +++ b/storage/innobase/handler/ha_innodb.cc
      @@ -21425,6 +21425,7 @@ static TABLE* innodb_acquire_mdl(THD* thd, dict_table_t* table)
       
       	if (!table_name_parse(table->name, db_buf, tbl_buf,
       			      db_buf_len, tbl_buf_len)) {
      +		table->release();
       		return NULL;
       	}
       
      

      This bug was found during the development of a backup-friendly TRUNCATE (RENAME, CREATE, DROP) in MDEV-13564. It would occasionally cause the TRUNCATE TABLE statement to hang during the DROP part in the test gcol.innodb_virtual_purge_debug.

      A similar hang should be possible in a table-rebuilding ALTER TABLE of a table that had indexed virtual columns before the operation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                marko Marko Mäkelä
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: