Skip to content
  • Dmitry Shulga's avatar
    b6c360a9
    Bug #26831155 -- CONCURRENT DDL OPERATION IN PROGRESS EVEN AFTER ACQUIRING BACKUP LOCK · b6c360a9
    Dmitry Shulga authored
    In some cases there is possibility that LOCK INSTANCE FOR BACKUP interleaved with
    handling of DDL statement in a such way that LOCK INSTANCE FOR BACKUP
    ignores the fact of running DDL in parallel. In result both LOCK INSTANCE FOR BACKUP
    and DDL are running concurrently and finished successfully without waiting on mdl lock.
    
    The reason for the bug was that shared mdl for Back Lock is acquired right before
    implicit commit is handled and transactional mdl locks are released for statements
    having flag CF_IMPLICIT_COMMIT_BEGIN set. Such statements are almost all DDL statements.
    
    To fix the bug acquiring of shared mdl for Backup Lock as part of handling DDL statement
    is moved to lower layer where real table opening/locking is done. For some statements
    that don't acquire backup lock implicitly during table opening/locking phase
    explicit request for backup lock is done. Asserts were added to methods of the class
    Dictionary_client to check that IX MDL for Backup Lock is acquired for operations
    that change metadata in data-dictionary or ACL tables.
    b6c360a9
    Bug #26831155 -- CONCURRENT DDL OPERATION IN PROGRESS EVEN AFTER ACQUIRING BACKUP LOCK
    Dmitry Shulga authored
    In some cases there is possibility that LOCK INSTANCE FOR BACKUP interleaved with
    handling of DDL statement in a such way that LOCK INSTANCE FOR BACKUP
    ignores the fact of running DDL in parallel. In result both LOCK INSTANCE FOR BACKUP
    and DDL are running concurrently and finished successfully without waiting on mdl lock.
    
    The reason for the bug was that shared mdl for Back Lock is acquired right before
    implicit commit is handled and transactional mdl locks are released for statements
    having flag CF_IMPLICIT_COMMIT_BEGIN set. Such statements are almost all DDL statements.
    
    To fix the bug acquiring of shared mdl for Backup Lock as part of handling DDL statement
    is moved to lower layer where real table opening/locking is done. For some statements
    that don't acquire backup lock implicitly during table opening/locking phase
    explicit request for backup lock is done. Asserts were added to methods of the class
    Dictionary_client to check that IX MDL for Backup Lock is acquired for operations
    that change metadata in data-dictionary or ACL tables.
Loading