A granted metadata lock.
More...
#include <mdl.h>
A granted metadata lock.
- Warning
- MDL_ticket members are private to the MDL subsystem.
- Note
- Multiple shared locks on a same object are represented by a single ticket. The same does not apply for other lock types.
-
There are two groups of MDL_ticket members:
- "Externally accessible". These members can be accessed from threads/contexts different than ticket owner in cases when ticket participates in some list of granted or waiting tickets for a lock. Therefore one should change these members before including then to waiting/granted lists or while holding lock protecting those lists.
- "Context private". Such members are private to thread/context owning this ticket. I.e. they should not be accessed from other threads/contexts.
◆ enum_psi_status
Status of lock request represented by the ticket as reflected in P_S.
Enumerator |
---|
PENDING | |
GRANTED | |
PRE_ACQUIRE_NOTIFY | |
POST_RELEASE_NOTIFY | |
◆ MDL_ticket() [1/2]
◆ ~MDL_ticket()
MDL_ticket::~MDL_ticket |
( |
| ) |
|
|
inlineoverrideprivate |
◆ MDL_ticket() [2/2]
◆ accept_visitor()
Implement MDL_wait_for_subgraph interface.
Traverse a portion of wait-for graph which is reachable through the edge represented by this ticket and search for deadlocks.
- Return values
-
true | A deadlock is found. A pointer to deadlock victim is saved in the visitor. |
false | TBD |
Implements MDL_wait_for_subgraph.
◆ create()
Auxiliary functions needed for creation/destruction of MDL_ticket objects.
◆ destroy()
◆ downgrade_lock()
Downgrade an EXCLUSIVE or SHARED_NO_WRITE lock to shared metadata lock.
- Parameters
-
new_type | Type of lock to which exclusive lock should be downgraded. |
◆ get_ctx()
◆ get_deadlock_weight()
uint MDL_ticket::get_deadlock_weight |
( |
| ) |
const |
|
overridevirtual |
Return the 'weight' of this ticket for the victim selection algorithm.
Requests with lower weight are preferred to requests with higher weight when choosing a victim.
- Note
- When MDL_context::m_force_dml_deadlock_weight is set, the return value of this method is ignored and DEADLOCK_WEIGHT_DML is used for the context.
Implements MDL_wait_for_subgraph.
◆ get_duration()
◆ get_key()
const MDL_key * MDL_ticket::get_key |
( |
| ) |
const |
Return a key identifying this lock.
◆ get_lock()
MDL_lock * MDL_ticket::get_lock |
( |
| ) |
const |
|
inline |
◆ get_type()
◆ has_pending_conflicting_lock()
bool MDL_ticket::has_pending_conflicting_lock |
( |
| ) |
const |
Check if we have any pending locks which conflict with existing shared lock.
- Precondition
- The ticket must match an acquired lock.
- Returns
- true if there is a conflicting lock request, false otherwise.
◆ has_stronger_or_equal_type()
bool MDL_ticket::has_stronger_or_equal_type |
( |
enum_mdl_type |
type | ) |
const |
Check if ticket represents metadata lock of "stronger" or equal type than specified one.
I.e. if metadata lock represented by ticket won't allow any of locks which are not allowed by specified type of lock.
- Returns
- true if ticket has stronger or equal type false otherwise.
◆ is_incompatible_when_granted()
bool MDL_ticket::is_incompatible_when_granted |
( |
enum_mdl_type |
type | ) |
const |
◆ is_incompatible_when_waiting()
bool MDL_ticket::is_incompatible_when_waiting |
( |
enum_mdl_type |
type | ) |
const |
◆ is_upgradable_or_exclusive()
bool MDL_ticket::is_upgradable_or_exclusive |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ set_duration()
◆ MDL_context
◆ m_ctx
Context of the owner of the metadata lock ticket.
Externally accessible.
◆ m_duration
Duration of lock represented by this ticket.
Context private. Debug-only.
◆ m_hton_notified
bool MDL_ticket::m_hton_notified |
|
private |
Indicates that ticket corresponds to lock request which required storage engine notification during its acquisition and requires storage engine notification after its release.
◆ m_is_fast_path
bool MDL_ticket::m_is_fast_path |
|
private |
Indicates that ticket corresponds to lock acquired using "fast path" algorithm.
Particularly this means that it was not included into MDL_lock::m_granted bitmap/list and instead is accounted for by MDL_lock::m_fast_path_locks_granted_counter
◆ m_lock
Pointer to the lock object for this lock ticket.
Externally accessible.
◆ m_psi
◆ m_type
Type of metadata lock.
Externally accessible.
◆ next_in_context
Pointers for participating in the list of lock requests for this context.
Context private.
◆ next_in_lock
Pointers for participating in the list of satisfied/pending requests for the lock.
Externally accessible.
◆ prev_in_context
◆ prev_in_lock
The documentation for this class was generated from the following files: