[Maria-developers] doubt about MDL
hi guys, i'm reading https://github.com/MariaDB/server/blob/10.1/sql/mdl.h i'm with a doubt... today we have the metadata lock plugin to check what mdl we have... my doubt is, how to expose how many threads are sharing the mdl key, and how many threads are waiting the mdl key, should it be possible or only one threrad could use one mdl? -- Roberto Spadim
Hi, Roberto! On Oct 13, Roberto Spadim wrote:
hi guys, i'm reading https://github.com/MariaDB/server/blob/10.1/sql/mdl.h i'm with a doubt... today we have the metadata lock plugin to check what mdl we have... my doubt is, how to expose how many threads are sharing the mdl key, and how many threads are waiting the mdl key, should it be possible or only one threrad could use one mdl?
MDL_key is not a lock, it's just an object key - it specifies what object is locked (or a lock is requested on). Many threads can wait for the same object, of course. Threads do not share the logical lock, if two threads got a shared lock on some object - every thread got its own shared lock, not two threads got the same lock. Logically. But in the code all these shared locks are represented by one MDL_ticket object, not many. Regards, Sergei
hummm, understook, it's something that include a deadlock too, now i'm understanding somethings more about mdl.... i didn't checked yet how the list of locks are handled to create some mdl informations, like what thread(s) is wait one specific mdl lock, for example a update (myisam/aria) running and a select waiting update or something like it
humm it's something like a structure to handle locks and some features to deadlocks? i'm thinking about what it could help with "why one thread is locked/waiting lock with processlist information schema" instead of only 'waiting metadata table lock' know exactly what process/table have the lock, and how many locks it have
participants (2)
-
Roberto Spadim
-
Sergei Golubchik