MySQL 8.4.3
Source Code Documentation
MDL_context_backup_manager::MDL_context_backup Class Reference

Wrapper around MDL_context class which allows to store it in backup manager's collection. More...

Inheritance diagram for MDL_context_backup_manager::MDL_context_backup:
[legend]

Public Member Functions

 MDL_context_backup ()
 
 ~MDL_context_backup () override
 
MDL_contextget_context ()
 
- Public Member Functions inherited from MDL_context_owner
virtual ~MDL_context_owner ()=default
 

Private Member Functions

void enter_cond (mysql_cond_t *, mysql_mutex_t *, const PSI_stage_info *, PSI_stage_info *, const char *, const char *, int) override
 Enter a condition wait. More...
 
void exit_cond (const PSI_stage_info *, const char *, const char *, int) override
 End a wait on a condition. More...
 
int is_killed () const override
 Has the owner thread been killed? More...
 
bool might_have_commit_order_waiters () const final
 Indicates that owner thread might have some commit order (non-MDL) waits for it which are still taken into account by MDL deadlock detection, even in cases when it doesn't have any MDL locks acquired and therefore can't have any MDL waiters. More...
 
THDget_thd () override
 
void notify_shared_lock (MDL_context_owner *, bool) override
 
bool notify_hton_pre_acquire_exclusive (const MDL_key *, bool *) override
 Notify/get permission from interested storage engines before acquiring exclusive lock for the key. More...
 
void notify_hton_post_release_exclusive (const MDL_key *) override
 Notify interested storage engines that we have just released exclusive lock for the key. More...
 
uint get_rand_seed () const override
 Get random seed specific to this THD to be used for initialization of PRNG for the MDL_context. More...
 
bool is_connected (bool=false) override
 Does the owner still have connection to the client? More...
 

Private Attributes

MDL_context m_context
 

Detailed Description

Wrapper around MDL_context class which allows to store it in backup manager's collection.

Also implements MDL_context_owner interface and serves as owner for stored MDL_context.

Constructor & Destructor Documentation

◆ MDL_context_backup()

MDL_context_backup_manager::MDL_context_backup::MDL_context_backup ( )
inline

◆ ~MDL_context_backup()

MDL_context_backup_manager::MDL_context_backup::~MDL_context_backup ( )
inlineoverride

Member Function Documentation

◆ enter_cond()

void MDL_context_backup_manager::MDL_context_backup::enter_cond ( mysql_cond_t cond,
mysql_mutex_t mutex,
const PSI_stage_info stage,
PSI_stage_info old_stage,
const char *  src_function,
const char *  src_file,
int  src_line 
)
inlineoverrideprivatevirtual

Enter a condition wait.

For enter_cond() / exit_cond() to work the mutex must be held before enter_cond(); this mutex must then be released before exit_cond(). Usage must be: lock mutex; enter_cond(); your code; unlock mutex; exit_cond().

Parameters
condthe condition to wait on
mutexthe associated mutex
[in]stagethe stage to enter, or NULL
[out]old_stagethe previous stage, or NULL
src_functionfunction name of the caller
src_filefile name of the caller
src_lineline number of the caller
See also
ENTER_COND(), THD::enter_cond()
EXIT_COND(), THD::exit_cond()

Implements MDL_context_owner.

◆ exit_cond()

void MDL_context_backup_manager::MDL_context_backup::exit_cond ( const PSI_stage_info stage,
const char *  src_function,
const char *  src_file,
int  src_line 
)
inlineoverrideprivatevirtual

End a wait on a condition.

Parameters
[in]stagethe new stage to enter
src_functionfunction name of the caller
src_filefile name of the caller
src_lineline number of the caller
See also
ENTER_COND(), THD::enter_cond()
EXIT_COND(), THD::exit_cond()

Implements MDL_context_owner.

◆ get_context()

MDL_context * MDL_context_backup_manager::MDL_context_backup::get_context ( )
inline

◆ get_rand_seed()

uint MDL_context_backup_manager::MDL_context_backup::get_rand_seed ( ) const
inlineoverrideprivatevirtual

Get random seed specific to this THD to be used for initialization of PRNG for the MDL_context.

Implements MDL_context_owner.

◆ get_thd()

THD * MDL_context_backup_manager::MDL_context_backup::get_thd ( )
inlineoverrideprivatevirtual
Warning
Since there is no THD associated with This method returns nullptr unconditionally.

Implements MDL_context_owner.

◆ is_connected()

bool MDL_context_backup_manager::MDL_context_backup::is_connected ( bool  = false)
inlineoverrideprivatevirtual

Does the owner still have connection to the client?

Implements MDL_context_owner.

◆ is_killed()

int MDL_context_backup_manager::MDL_context_backup::is_killed ( ) const
inlineoverrideprivatevirtual

Has the owner thread been killed?

Implements MDL_context_owner.

◆ might_have_commit_order_waiters()

bool MDL_context_backup_manager::MDL_context_backup::might_have_commit_order_waiters ( ) const
inlinefinalprivatevirtual

Indicates that owner thread might have some commit order (non-MDL) waits for it which are still taken into account by MDL deadlock detection, even in cases when it doesn't have any MDL locks acquired and therefore can't have any MDL waiters.

Note
It is important for this check to be non-racy and quick (perhaps at expense of being pretty pessimistic), so it can be used to make decisions reliably about whether we can skip deadlock detection in some cases.

Implements MDL_context_owner.

◆ notify_hton_post_release_exclusive()

void MDL_context_backup_manager::MDL_context_backup::notify_hton_post_release_exclusive ( const MDL_key mdl_key)
inlineoverrideprivatevirtual

Notify interested storage engines that we have just released exclusive lock for the key.

Implements MDL_context_owner.

◆ notify_hton_pre_acquire_exclusive()

bool MDL_context_backup_manager::MDL_context_backup::notify_hton_pre_acquire_exclusive ( const MDL_key mdl_key,
bool *  victimized 
)
inlineoverrideprivatevirtual

Notify/get permission from interested storage engines before acquiring exclusive lock for the key.

The returned argument 'victimized' specify reason for lock not granted. If 'true', lock was refused in an attempt to resolve a possible MDL->GSL deadlock. Locking may then be retried.

Returns
False if notification was successful and it is OK to acquire lock, True if one of SEs asks to abort lock acquisition.

Implements MDL_context_owner.

◆ notify_shared_lock()

void MDL_context_backup_manager::MDL_context_backup::notify_shared_lock ( MDL_context_owner in_use,
bool  needs_thr_lock_abort 
)
inlineoverrideprivatevirtual
See also
THD::notify_shared_lock()

Implements MDL_context_owner.

Member Data Documentation

◆ m_context

MDL_context MDL_context_backup_manager::MDL_context_backup::m_context
private

The documentation for this class was generated from the following file: