Commit cf23a80
Dmitry Lenev
Fix for sporadical crashes of lock_multi_bug38499.test
caused by patch which implemented new type-of-operation-aware
metadata locks and added a wait-for graph based deadlock
detector to the MDL subsystem (this patch fixed bug #46272
"MySQL 5.4.4, new MDL: unnecessary deadlock" and bug #37346
"innodb does not detect deadlock between update and alter
table").
Crashes were caused by a race in MDL_context::try_acquire_lock().
This method added MDL_ticket to the list of granted tickets and
released lock protecting list before setting MDL_ticket::m_lock.
Thus some other thread was able to see ticket without properly
set m_lock member for some short period of time. If this thread
called method involving this member during this period crash
happened.
This fix ensures that MDL_ticket::m_lock is set in all cases
when ticket is added to granted/pending lists in MDL_lock.
--BZR--
revision-id: [email protected]
property-branch-nick: mysql-next-4284-nl-push
property-file-info: ld7:file_id40:mdl.cc-20080523121737-j62pi0m62eaw1hq6-17:message324:We must set MDL_ticket::m_lock member before adding ticket
property-file-info: to the list of granted tickets, since such tickets can be
property-file-info: accessed by other threads which might call methods using
property-file-info: this member.
property-file-info: Added assert which ensures that all MDL_tickets which are
property-file-info: added to the granted/pending lists have properly set
property-file-info: MDL_ticket::m_lock member.4:path10:sql/mdl.cced7:file_id39:mdl.h-20080523121748-o4y2wcq3maotb9do-17:message120:Adjusted comment describing MDL_ticket::m_lock member to
property-file-info: reflect current reality.
property-file-info: Added accessor method for this member.4:path9:sql/mdl.hee
testament3-sha1: c51a82262c714dad4615811908b8ef1f87b5c2761 parent d75921b commit cf23a80
2 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
841 | 847 | | |
842 | 848 | | |
843 | 849 | | |
| |||
1317 | 1323 | | |
1318 | 1324 | | |
1319 | 1325 | | |
| 1326 | + | |
1320 | 1327 | | |
1321 | 1328 | | |
1322 | 1329 | | |
1323 | | - | |
1324 | | - | |
1325 | 1330 | | |
1326 | 1331 | | |
1327 | 1332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | 403 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
426 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
| |||
0 commit comments