MySQL 8.3.0
Source Code Documentation
Transaction_consistency_info Class Reference

The consistency information of a transaction, including its configuration and state. More...

#include <consistency_manager.h>

Public Member Functions

void * operator new (size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 
void * operator new (size_t size) noexcept
 Allocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked. More...
 
void operator delete (void *ptr) noexcept
 Deallocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked. More...
 
 Transaction_consistency_info (my_thread_id thread_id, bool local_transaction, const gr::Gtid_tsid &tsid, bool is_tsid_specified, rpl_sidno sidno, rpl_gno gno, enum_group_replication_consistency_level consistency_level, Members_list *members_that_must_prepare_the_transaction)
 Constructor. More...
 
virtual ~Transaction_consistency_info ()
 
my_thread_id get_thread_id ()
 Get the thread id that is executing the transaction. More...
 
bool is_local_transaction ()
 Is the transaction from this server? More...
 
bool is_transaction_prepared_locally ()
 Is the transaction prepared locally? More...
 
rpl_sidno get_sidno ()
 Get the transaction sidno. More...
 
rpl_gno get_gno ()
 Get the transaction gno. More...
 
enum_group_replication_consistency_level get_consistency_level ()
 Get the transaction consistency. More...
 
bool is_a_single_member_group ()
 Is this transaction running on a single member group? More...
 
bool is_the_transaction_prepared_remotely ()
 Did all other ONLINE members already prepared the transaction? More...
 
int after_applier_prepare (my_thread_id thread_id, Group_member_info::Group_member_status member_status)
 Call action after this transaction being prepared on this member applier. More...
 
int handle_remote_prepare (const Gcs_member_identifier &gcs_member_id)
 Call action after this transaction being prepared by other member. More...
 
int handle_member_leave (const std::vector< Gcs_member_identifier > &leaving_members)
 Call action after members leave the group. More...
 
uint64_t get_begin_timestamp () const
 Return the time at which the wait for the transaction prepare acknowledge from others members did start. More...
 

Private Attributes

my_thread_id m_thread_id
 
const bool m_local_transaction
 
const bool m_tsid_specified
 
gr::Gtid_tsid m_tsid
 
const rpl_sidno m_sidno
 
const rpl_gno m_gno
 
const enum_group_replication_consistency_level m_consistency_level
 
Members_listm_members_that_must_prepare_the_transaction
 
std::unique_ptr< Checkable_rwlockm_members_that_must_prepare_the_transaction_lock
 
bool m_transaction_prepared_locally
 
bool m_transaction_prepared_remotely
 
const uint64_t m_begin_timestamp
 

Detailed Description

The consistency information of a transaction, including its configuration and state.

Constructor & Destructor Documentation

◆ Transaction_consistency_info()

Transaction_consistency_info::Transaction_consistency_info ( my_thread_id  thread_id,
bool  local_transaction,
const gr::Gtid_tsid tsid,
bool  is_tsid_specified,
rpl_sidno  sidno,
rpl_gno  gno,
enum_group_replication_consistency_level  consistency_level,
Members_list members_that_must_prepare_the_transaction 
)

Constructor.

Parameters
[in]thread_idthe thread that is executing the transaction
[in]local_transactiontrue if this transaction did originate from this server
[in]tsidtransaction tsid
[in]is_tsid_specifiedinformation on whether tsid is specified
[in]sidnotransaction sidno
[in]gnotransaction gno
[in]consistency_levelthe transaction consistency
[in]members_that_must_prepare_the_transactionlist of the members that must prepare the transaction before it is allowed to commit

◆ ~Transaction_consistency_info()

Transaction_consistency_info::~Transaction_consistency_info ( )
virtual

Member Function Documentation

◆ after_applier_prepare()

int Transaction_consistency_info::after_applier_prepare ( my_thread_id  thread_id,
Group_member_info::Group_member_status  member_status 
)

Call action after this transaction being prepared on this member applier.

Parameters
[in]thread_idthe applier thread id
[in]member_statusthis member status
Returns
Operation status
Return values
0OK
!=0error

◆ get_begin_timestamp()

uint64_t Transaction_consistency_info::get_begin_timestamp ( ) const

Return the time at which the wait for the transaction prepare acknowledge from others members did start.

See also
Metrics_handler::get_current_time()
Returns
the wait for remote transaction acknowledge begin time.

◆ get_consistency_level()

enum_group_replication_consistency_level Transaction_consistency_info::get_consistency_level ( )

Get the transaction consistency.

Returns
the consistency

◆ get_gno()

rpl_gno Transaction_consistency_info::get_gno ( )

Get the transaction gno.

Returns
the gno

◆ get_sidno()

rpl_sidno Transaction_consistency_info::get_sidno ( )

Get the transaction sidno.

Returns
the sidno

◆ get_thread_id()

my_thread_id Transaction_consistency_info::get_thread_id ( )

Get the thread id that is executing the transaction.

Returns
the thread id

◆ handle_member_leave()

int Transaction_consistency_info::handle_member_leave ( const std::vector< Gcs_member_identifier > &  leaving_members)

Call action after members leave the group.

If any of these members are on the prepare wait list, they will be removed. If the lists becomes empty, the transaction will proceed to commit.

Parameters
[in]leaving_membersthe members that left
Returns
Operation status
Return values
0OK
!=0error

◆ handle_remote_prepare()

int Transaction_consistency_info::handle_remote_prepare ( const Gcs_member_identifier gcs_member_id)

Call action after this transaction being prepared by other member.

Parameters
[in]gcs_member_idthe member id
Returns
Operation status
Return values
CONSISTENCY_INFO_OUTCOME_OKOK
CONSISTENCY_INFO_OUTCOME_ERRORerror
CONSISTENCY_INFO_OUTCOME_COMMITtransaction must proceeded to commit

◆ is_a_single_member_group()

bool Transaction_consistency_info::is_a_single_member_group ( )

Is this transaction running on a single member group?

Returns
true yes false otherwise

◆ is_local_transaction()

bool Transaction_consistency_info::is_local_transaction ( )

Is the transaction from this server?

Returns
true yes false otherwise

◆ is_the_transaction_prepared_remotely()

bool Transaction_consistency_info::is_the_transaction_prepared_remotely ( )

Did all other ONLINE members already prepared the transaction?

Returns
true yes false otherwise

◆ is_transaction_prepared_locally()

bool Transaction_consistency_info::is_transaction_prepared_locally ( )

Is the transaction prepared locally?

Returns
true yes false otherwise

◆ operator delete() [1/2]

void Transaction_consistency_info::operator delete ( void *  ptr)
inlinenoexcept

Deallocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked.

Parameters
[in]ptrpointer to the allocated memory

◆ operator delete() [2/2]

void Transaction_consistency_info::operator delete ( void *  ptr,
const std::nothrow_t &   
)
inlinenoexcept

◆ operator new() [1/2]

void * Transaction_consistency_info::operator new ( size_t  size)
inlinenoexcept

Allocate memory on the heap with instrumented memory allocation, so that memory consumption can be tracked.

Parameters
[in]sizememory size to be allocated
Returns
pointer to the allocated memory, or NULL if memory could not be allocated.

◆ operator new() [2/2]

void * Transaction_consistency_info::operator new ( size_t  size,
const std::nothrow_t &   
)
inlinenoexcept

Member Data Documentation

◆ m_begin_timestamp

const uint64_t Transaction_consistency_info::m_begin_timestamp
private

◆ m_consistency_level

const enum_group_replication_consistency_level Transaction_consistency_info::m_consistency_level
private

◆ m_gno

const rpl_gno Transaction_consistency_info::m_gno
private

◆ m_local_transaction

const bool Transaction_consistency_info::m_local_transaction
private

◆ m_members_that_must_prepare_the_transaction

Members_list* Transaction_consistency_info::m_members_that_must_prepare_the_transaction
private

◆ m_members_that_must_prepare_the_transaction_lock

std::unique_ptr<Checkable_rwlock> Transaction_consistency_info::m_members_that_must_prepare_the_transaction_lock
private

◆ m_sidno

const rpl_sidno Transaction_consistency_info::m_sidno
private

◆ m_thread_id

my_thread_id Transaction_consistency_info::m_thread_id
private

◆ m_transaction_prepared_locally

bool Transaction_consistency_info::m_transaction_prepared_locally
private

◆ m_transaction_prepared_remotely

bool Transaction_consistency_info::m_transaction_prepared_remotely
private

◆ m_tsid

gr::Gtid_tsid Transaction_consistency_info::m_tsid
private

◆ m_tsid_specified

const bool Transaction_consistency_info::m_tsid_specified
private

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