[MDEV-4748] metadata_lock_info plugin Created: 2013-07-02 Updated: 2013-12-16 Resolved: 2013-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | 10.0.7 |
| Type: | Task | Priority: | Minor |
| Reporter: | Sergey Vojtovich | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Kentoku Shiba (author of Spider storage engine) suggests metadata_lock_info plugin: This plugin makes it possible knowing "who has metadata locks". In development stage, sometimes DBAs meet metadata locks when using alter table statement. This metadata locks are sometimes caused by GUI tools. In service stage, sometimes DBAs meet metadata locks when using alter table statement. This metadata locks are sometimes caused by long batch processing. In many cases, the DBAs need to judge immediately. So I made it for all DBAs. Plugin is available at: |
| Comments |
| Comment by roberto spadim [ 2013-08-26 ] |
|
Some strange names in columns.... SELECT GET_LOCK('abc',1000); you will get DB = 'abc', that's not a true information, the 'abc' is the key of the MDL lock, not the database (DB), maybe we should have a "KEY" and a "SUB_KEY" here? example... DB and TABLE, when a table lock, or GET_LOCK key name and '' for sub key maybe we could change somethings... from mdl.h from mdl.cc, why not use "m_namespace_to_wait_state_name" names, or maybe add this information to mdl.h ? the "lock_type" (namescape) don't have a name in mdl.h yet, maybe should be nice one there? PSI_stage_info MDL_key::m_namespace_to_wait_state_name[NAMESPACE_END]= , , , , , , , , /* Be compatible with old status. */ well |
| Comment by roberto spadim [ 2013-08-26 ] |
|
for query id: table->field[0] table->field[ QUERY_ID COLUMN NUMBER ] |
| Comment by roberto spadim [ 2013-08-26 ] |
|
other column to add is the "duration" variable enum enum_mdl_duration { /** Locks with statement duration are automatically released at the end of statement or transaction. */ MDL_STATEMENT= 0, /** Locks with transaction duration are automatically released at the end of transaction. */ MDL_TRANSACTION, /** Locks with explicit duration survive the end of statement and transaction. They have to be released explicitly by calling MDL_context::release_lock(). */ MDL_EXPLICIT, /* This should be the last ! */ MDL_DURATION_END } |
| Comment by roberto spadim [ 2013-08-27 ] |
|
Added file with changes that i talked in comments |
| Comment by Sergey Vojtovich [ 2013-12-13 ] |
|
Pushed to 10.0.7, |