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

set lock_wait_timeout = 1;flush tables with read lock; lock not released after timeout

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.0.13, 10.1.22, 10.2.5, 10.0, 10.1, 10.2
    • Fix Version/s: 10.1.25, 10.2.7, 10.3.1
    • Component/s: Locking
    • Labels:
      None
    • Environment:
      probably all, tested on Centos 6 and Ubuntu Xenial.

      Description

      Reproducing:

      Prepare:

      Drop table if exists t;
      CREATE TABLE `t` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 ;
      

      Session 1:

      set autocommit = 0;
      insert into t values(1);
      select sleep(10) from t;
      

      Session 2 (execute before sleep(10) is finshed)

      set lock_wait_timeout = 1;flush tables with read lock;
      

      Checked with metadata plugin:

      MariaDB [(none)]> select *                
          -> from information_schema.METADATA_LOCK_INFO;
      Select thread_id,lock_mode,lock_type
       from information_schema.METADATA_LOCK_INFO;
      +-----------+------------+------------------+
      | thread_id | lock_mode  | lock_type        |
      +-----------+------------+------------------+
      |         7 | MDL_SHARED | Global read lock |
      |         7 | MDL_SHARED | Commit lock      |
      |         6 | MDL_SHARED_WRITE | Table metadata lock      |
      +-----------+------------+------------------+
      

      Even if the metadatalock from the uncommited transaction from session 1 will be released with abort session 1, commit lock and global read lock still exists.

        Attachments

          Activity

            People

            • Assignee:
              svoj Sergey Vojtovich
              Reporter:
              Richard Richard Stracke
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: