Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FB8-98, FB8-126, FB8-127: Introducing high priority DDLs (facebook#1011…
…) (facebook#1011) Summary: Jira ticket: https://jira.percona.com/browse/FB8-98 Reference commit: 2b59a06 Reference commit: f816fee Reference commit: 397fa65 Reference commit: 00323f7 Reference commit: bffb8d7 Reference commit: e9cb575 Reference commit: b145f26 Reference commit: 7e41852 Reference commit: 434d496 Reference commit: facebook@ee63260f74b -------- 2b59a06 -------- This diff introduces high priority DDLs. If enabled, DDLs will kill the blocking connections that hold shared metadata locks. Below are the details: - Added high_priority_ddl system variable that will allow DDL to kill blocking connections which hold shared locks. High priority DDLs are only available to admin users. By default the functionality is turned off. - Only the shared locks (read/write) will be affected, which are DML queries such as select, insert, update, etc. Any lock higher than upgradable MDL (i.e. from conflicting DDL) will not be affected. - When killing the blocking connections, their transactions will automatically be rolled back. This is the same behavior as `kill processlist_id` command. - The DDL will kill blocking connections at the end of the timeout instead of instantly. Admin can control the waiting period by setting the session lock_wait_timeout before issuing the DDL. -------- 397fa65 -------- This feature has been dropped. Adding high_priority syntax in DDL commands This diff introduces `HIGH_PRIORITY` syntax in some DDL commands and optimize command. The purpose is the same as the system variable `high_priority_ddl` which is described in D4784076 (facebook@2b59a06). The list of commands that support `HIGH_PRIORITY` syntax is: - create/drop/alter/truncate table - create/drop index - create/drop trigger - optimize table With this diff, there are two ways of issuing high priority DDLs: e.g. `CREATE HIGH_PRIORITY INDEX ...` Recap of the high_priority ddl feature: - Only the shared locks (read/write) will be affected, which are DML queries such as select, insert, update, etc. Any lock higher than upgradable MDL (i.e. from conflicting DDL) will not be affected. - When killing the blocking connections, their transactions will automatically be rolled back. This is the same behavior as `kill processlist_id` command. - The DDL will kill blocking connections at the end of the timeout instead of instantly. Admin can control the waiting period by setting the session lock_wait_timeout before issuing the DDL. -------- b145f26 -------- Add LOCK TABLES as a supported command for high priority ddl Although LOCK TABLES is not a ddl command, it is useful to have it support taking mdl locks with high priority, via the high_priority_ddl session variable. -------- 7e41852 -------- Add high_priority_lock_wait_timeout system variable The original lock_wait_timeout is used for all queries and also the long running slave threads. It'll be better that high_priority commands (DDLs) use a separate system variable for timeout, which can be used across the master/slaves without messing with lock_wait_timeout. This diff introduces a new system variable high_priority_lock_wait_timeout that can be set for high_priority command's lock wait timeout, after which the command's thread will kill shared locks that are blocking the command. The new variable doesn't apply to regular queries. Pull Request resolved: facebook#1011 Differential Revision: D14884073 Pulled By: hermanlee
- Loading branch information