MySQL 8.0.39
Source Code Documentation
|
Keeps the THD session context to be used with the Bgc_ticket_manager
.
More...
#include <rpl_context.h>
Public Member Functions | |
Binlog_group_commit_ctx ()=default | |
virtual | ~Binlog_group_commit_ctx ()=default |
binlog::BgcTicket | get_session_ticket () |
Retrieves the ticket that the THD session has been assigned to. More... | |
void | set_session_ticket (binlog::BgcTicket ticket) |
Sets the THD session's ticket to the given value. More... | |
void | assign_ticket () |
Assigns the THD session to the ticket accepting assignments in the ticket manager. More... | |
bool | has_waited () |
Whether or not the session already waited on the ticket. More... | |
void | mark_as_already_waited () |
Marks the underlying session has already waited on the ticket. More... | |
void | reset () |
Resets the THD session's ticket context. More... | |
std::string | to_string () const |
Returns the textual representation of this object;. More... | |
void | format (std::ostream &out) const |
Dumps the textual representation of this object into the given output stream. More... | |
void | set_max_size_exceeded (bool value) |
Set whether binlog max size was exceeded. More... | |
void | set_force_rotate () |
Turn on forced rotate at end of BGC. More... | |
Static Public Member Functions | |
static memory::Aligned_atomic< bool > & | manual_ticket_setting () |
Retrieves the flag for determining if it should be possible to manually set the session's ticket. More... | |
static std::pair< bool, bool > | aggregate_rotate_settings (THD *queue) |
Aggregate the rotate requests over all sessions in queue. More... | |
Private Attributes | |
binlog::BgcTicket | m_session_ticket {0} |
The ticket the THD session has been assigned to. More... | |
bool | m_has_waited {false} |
Whether or not the session already waited on the ticket. More... | |
bool | m_max_size_exceeded {false} |
Whether session detected that binlog max size was exceeded. More... | |
bool | m_force_rotate {false} |
Whether session requests forced rotate. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, Binlog_group_commit_ctx const &to_dump) |
Dumps the textual representation of an instance of this class into the given output stream. More... | |
Keeps the THD session context to be used with the Bgc_ticket_manager
.
In particular, manages the value of the ticket the current THD session has been assigned to.
|
default |
|
virtualdefault |
|
static |
Aggregate the rotate requests over all sessions in queue.
void Binlog_group_commit_ctx::assign_ticket | ( | ) |
Assigns the THD session to the ticket accepting assignments in the ticket manager.
The method is idem-potent within the execution of a statement. This means that it can be invoked several times during the execution of a command within the THD session that only once will the session be assign to a ticket.
void Binlog_group_commit_ctx::format | ( | std::ostream & | out | ) | const |
Dumps the textual representation of this object into the given output stream.
out | The stream to dump this object into. |
binlog::BgcTicket Binlog_group_commit_ctx::get_session_ticket | ( | ) |
Retrieves the ticket that the THD session has been assigned to.
If it hasn't been assigned to any yet, returns '0'.
0
if it hasn't. bool Binlog_group_commit_ctx::has_waited | ( | ) |
Whether or not the session already waited on the ticket.
|
static |
Retrieves the flag for determining if it should be possible to manually set the session's ticket.
void Binlog_group_commit_ctx::mark_as_already_waited | ( | ) |
Marks the underlying session has already waited on the ticket.
void Binlog_group_commit_ctx::reset | ( | void | ) |
Resets the THD session's ticket context.
|
inline |
Turn on forced rotate at end of BGC.
Thus performing a rotate although the max size has not been reached.
|
inline |
Set whether binlog max size was exceeded.
The max size exceeded condition must be checked with LOCK_log held and thus its done early during flush stage although not used until end of BGC. This is an optimization which avoids taking LOCK_log at end of BGC when no session has seen that the threshold has been exceeded.
void Binlog_group_commit_ctx::set_session_ticket | ( | binlog::BgcTicket | ticket | ) |
Sets the THD session's ticket to the given value.
ticket | The ticket to set the THD session to. |
std::string Binlog_group_commit_ctx::to_string | ( | ) | const |
Returns the textual representation of this object;.
|
friend |
Dumps the textual representation of an instance of this class into the given output stream.
out | The output stream to dump the instance to. |
to_dump | The class instance to dump to the output stream. |
|
private |
Whether session requests forced rotate.
|
private |
Whether or not the session already waited on the ticket.
|
private |
Whether session detected that binlog max size was exceeded.
|
private |
The ticket the THD session has been assigned to.