MySQL 8.0.40
Source Code Documentation
Mts_submode_database Class Reference

DB partitioned submode For significance of each method check definition of Mts_submode. More...

#include <rpl_mta_submode.h>

Inheritance diagram for Mts_submode_database:
[legend]

Public Member Functions

 Mts_submode_database ()
 
int schedule_next_event (Relay_log_info *rli, Log_event *ev) override
 Does necessary arrangement before scheduling next event. More...
 
void attach_temp_tables (THD *thd, const Relay_log_info *rli, Query_log_event *ev) override
 Logic to attach temporary tables. More...
 
void detach_temp_tables (THD *thd, const Relay_log_info *rli, Query_log_event *ev) override
 Logic to detach the temporary tables from the worker threads upon event execution. More...
 
Slave_workerget_least_occupied_worker (Relay_log_info *, Slave_worker_array *ws, Log_event *) override
 Logic to get least occupied worker when the sql mts_submode= database. More...
 
 ~Mts_submode_database () override=default
 
int wait_for_workers_to_finish (Relay_log_info *rli, Slave_worker *ignore=nullptr) override
 Function is called by Coordinator when it identified an event requiring sequential execution. More...
 
bool set_multi_threaded_applier_context (const Relay_log_info &rli, Log_event &ev) override
 Sets additional context before the event is set to execute. More...
 
- Public Member Functions inherited from Mts_submode
 Mts_submode ()=default
 
enum_mts_parallel_type get_type ()
 
virtual ~Mts_submode ()=default
 

Private Member Functions

bool unfold_transaction_payload_event (Format_description_event &fde, Transaction_payload_log_event &tple, std::vector< Log_event * > &events)
 

Additional Inherited Members

- Protected Attributes inherited from Mts_submode
enum_mts_parallel_type type
 

Detailed Description

DB partitioned submode For significance of each method check definition of Mts_submode.

Constructor & Destructor Documentation

◆ Mts_submode_database()

Mts_submode_database::Mts_submode_database ( )
inline

◆ ~Mts_submode_database()

Mts_submode_database::~Mts_submode_database ( )
overridedefault

Member Function Documentation

◆ attach_temp_tables()

void Mts_submode_database::attach_temp_tables ( THD thd,
const Relay_log_info rli,
Query_log_event ev 
)
overridevirtual

Logic to attach temporary tables.

Implements Mts_submode.

◆ detach_temp_tables()

void Mts_submode_database::detach_temp_tables ( THD thd,
const Relay_log_info rli,
Query_log_event ev 
)
overridevirtual

Logic to detach the temporary tables from the worker threads upon event execution.

Parameters
thdTHD instance
rliRelay_log_info pointer
evQuery_log_event that is being applied

Implements Mts_submode.

◆ get_least_occupied_worker()

Slave_worker * Mts_submode_database::get_least_occupied_worker ( Relay_log_info ,
Slave_worker_array ws,
Log_event  
)
overridevirtual

Logic to get least occupied worker when the sql mts_submode= database.

Parameters
wsarray of worker threads
Returns
slave worker thread

Implements Mts_submode.

◆ schedule_next_event()

int Mts_submode_database::schedule_next_event ( Relay_log_info rli,
Log_event ev 
)
overridevirtual

Does necessary arrangement before scheduling next event.

Returns
1 if error 0 no error

Implements Mts_submode.

◆ set_multi_threaded_applier_context()

bool Mts_submode_database::set_multi_threaded_applier_context ( const Relay_log_info ,
Log_event  
)
overridevirtual

Sets additional context before the event is set to execute.

Reimplemented from Mts_submode.

◆ unfold_transaction_payload_event()

bool Mts_submode_database::unfold_transaction_payload_event ( Format_description_event fde,
Transaction_payload_log_event tple,
std::vector< Log_event * > &  events 
)
private

◆ wait_for_workers_to_finish()

int Mts_submode_database::wait_for_workers_to_finish ( Relay_log_info rli,
Slave_worker ignore = nullptr 
)
overridevirtual

Function is called by Coordinator when it identified an event requiring sequential execution.

Creating sequential context for the event includes waiting for the assigned to Workers tasks to be completed and their resources such as temporary tables be returned to Coordinator's repository. In case all workers are waited Coordinator changes its group status.

Parameters
rliRelay_log_info instance of Coordinator
ignoreOptional Worker instance pointer if the sequential context is established due for the ignore Worker. Its resources are to be retained.
Note
Resources that are not occupied by Workers such as a list of temporary tables held in unused (zero-usage) records of APH are relocated to the Coordinator placeholder.
Returns
non-negative number of released by Workers partitions (one partition by one Worker can count multiple times)

or -1 to indicate there has been a failure on a not-ignored Worker as indicated by its running_status so synchronization can't succeed.

Implements Mts_submode.


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