-
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.
Dmitry Shulga authoredIn 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