WL#7957: Add MDL for tablespaces

Affects: Server-Prototype Only   —   Status: Complete

Abstract

This worklog will define and implement meta data locking (MDL) for tablespaces. This is specifically needed for general tablespaces for InnoDB, and for the already existing NDB tablespaces.

Overview

The current implementation of tablespace support for InnoDB does not use MDL for controlling concurrent access to the tablespace meta data. Additionally, InnoDB is in the process of implementing general tablespaces (WL#6205), which also need to lock the meta data. This is particularly important with the advent of the new global data dictionary where we will have tablespace meta data at the SQL level, not only at the SE level.

Statements affected

The execution of the following tablespace related SQL DDL statements will need to take MDL into account:

  • CREATE TABLESPACE
  • ALTER TABLESPACE
  • DROP TABLESPACE

Additionally, DDL statements affecting tablespace contents also must take MDL into account:

  • CREATE TABLE
  • ALTER TABLE
  • RENAME TABLE
  • TRUNCATE TABLE
  • LOCK TABLES
  • DROP TABLE

Existing DML statements will not need to take tablespace MDL into account, because the DML statements request MDL on the artifacts that are addressed (e.g. a table). Thus, the required synchronization is achieved by having the tablespace DDL operations also requesting MDL on the contents before allowing the execution to proceed.

By and large, the implementation of MDL support for tablespaces will be similar to the existing MDL support implementation for databases.