MySQL 8.4.2
Source Code Documentation
|
Set that keeps track of TSID locks taken in the current scope. More...
#include <locked_sidno_set.h>
Public Member Functions | |
Locked_sidno_set (Gtid_state >id_state) | |
Locked_sidno_set (Locked_sidno_set &src)=delete | |
void | add_lock_for_sidno (rpl_sidno sidno) |
Adds a given sidno to the internal set, does not acquire ownership. More... | |
void | lock () |
Locks recorded sidno locks, in order. More... | |
~Locked_sidno_set () | |
Destructor, releases all locks kept in the set. More... | |
Protected Types | |
using | Set_type = std::set< rpl_sidno > |
Type of the set used. More... | |
Protected Attributes | |
Set_type | m_sidno_set |
SIDs for which lock will be acquired. More... | |
std::reference_wrapper< Gtid_state > | m_gtid_state |
Reference to the current Gtid_state object (avoids using the global gtid_state variable in the class) More... | |
bool | m_locked = false |
Is set currently locked? More... | |
Set that keeps track of TSID locks taken in the current scope.
Provides dead-lock free mechanism for added sidnos, as sidnos are ordered in the set insuring a deterministic lock order Locks are added to the set by execution of the add_lock_for_sidno. Later, the user may call lock(), which will lock all recorded sidno locks. Locks will be released in destructor.
Used to optimize TSID locking/unlocking scheme (e.g. in assign_automatic_gtids_to_flush_group) to avoid constant locking/unlocking of TSID locks during the commit flush stage
|
protected |
Type of the set used.
cs::index::Locked_sidno_set::Locked_sidno_set | ( | Gtid_state & | gtid_state | ) |
|
delete |
cs::index::Locked_sidno_set::~Locked_sidno_set | ( | ) |
Destructor, releases all locks kept in the set.
void cs::index::Locked_sidno_set::add_lock_for_sidno | ( | rpl_sidno | sidno | ) |
Adds a given sidno to the internal set, does not acquire ownership.
sidno | TSID being considered |
may be called several times for one sidno
void cs::index::Locked_sidno_set::lock | ( | ) |
Locks recorded sidno locks, in order.
In case set is already locked, function does not take any action
|
protected |
Reference to the current Gtid_state object (avoids using the global gtid_state variable in the class)
|
protected |
Is set currently locked?
|
protected |
SIDs for which lock will be acquired.