MySQL 9.5.0
Source Code Documentation
rpl_rli_pdb.h File Reference

Go to the source code of this file.

Classes

struct  Slave_job_group
 
class  circular_buffer_queue< Element_type >
 The class defines a type of queue with a predefined max capacity that is implemented using the circular memory buffer. More...
 
class  Slave_committed_queue
 Group Assigned Queue whose first element identifies first gap in committed sequence. More...
 
class  Slave_jobs_queue
 
class  Slave_worker
 

Functions

Slave_workerget_least_occupied_worker (Relay_log_info *rli, Slave_worker_array *workers, Log_event *ev)
 Legends running throughout the module: More...
 
bool handle_slave_worker_stop (Slave_worker *worker, Slave_job_item *job_item)
 This function is called by both coordinator and workers. More...
 
bool set_max_updated_index_on_stop (Slave_worker *worker, Slave_job_item *job_item)
 This function is called by both coordinator and workers. More...
 
TABLEmts_move_temp_tables_to_thd (THD *, TABLE *)
 Relocation of the list of temporary tables to thd->temporary_tables. More...
 
TABLEmts_move_temp_tables_to_thd (THD *, TABLE *, enum_mts_parallel_type)
 
bool append_item_to_jobs (slave_job_item *job_item, Slave_worker *w, Relay_log_info *rli)
 Coordinator enqueues a job item into a Worker private queue. More...
 
Slave_workerget_thd_worker (const THD *thd)
 
int slave_worker_exec_job_group (Slave_worker *w, Relay_log_info *rli)
 apply one job group. More...
 

Variables

ulong w_rr
 

Function Documentation

◆ append_item_to_jobs()

bool append_item_to_jobs ( slave_job_item job_item,
Slave_worker worker,
Relay_log_info rli 
)

Coordinator enqueues a job item into a Worker private queue.

Parameters
job_itema pointer to struct carrying a reference to an event
workera pointer to the assigned Worker struct
rlia pointer to Relay_log_info of Coordinator
Returns
false Success. true Thread killed or worker stopped while waiting for successful enqueue.

◆ get_least_occupied_worker()

Slave_worker * get_least_occupied_worker ( Relay_log_info rli,
Slave_worker_array ws,
Log_event ev 
)

Legends running throughout the module:

C - Coordinator CP - checkpoint W - Worker

B-event event that Begins a group (a transaction) T-event event that Terminates a group (a transaction)

Legends running throughout the module:

Parameters
rlipointer to Relay_log_info of Coordinator
wsdynarray of pointers to Slave_worker
evevent for which we are searching for a worker
Returns
a pointer to chosen Slave_worker instance

◆ get_thd_worker()

Slave_worker * get_thd_worker ( const THD thd)
inline

◆ handle_slave_worker_stop()

bool handle_slave_worker_stop ( Slave_worker worker,
Slave_job_item job_item 
)

This function is called by both coordinator and workers.

Upon receiving the STOP command, the workers will identify a maximum group index already executed (or under execution).

All groups whose index are below or equal to the maximum group index will be applied by the workers before stopping.

The workers with groups above the maximum group index will exit without applying these groups by setting their running status to "STOP_ACCEPTED".

Parameters
workera pointer to the waiting Worker struct
job_itema pointer to struct carrying a reference to an event
Returns
true if STOP command gets accepted otherwise false is returned.

◆ mts_move_temp_tables_to_thd() [1/2]

TABLE * mts_move_temp_tables_to_thd ( THD thd,
TABLE temporary_tables 
)

Relocation of the list of temporary tables to thd->temporary_tables.

Parameters
thdTHD instance pointer of the destination
temporary_tablesthe source temporary_tables list
Note
destroying references to the source list, if necessary, is left to the caller.
Returns
the post-merge value of thd->temporary_tables.

◆ mts_move_temp_tables_to_thd() [2/2]

TABLE * mts_move_temp_tables_to_thd ( THD ,
TABLE ,
enum_mts_parallel_type   
)

◆ set_max_updated_index_on_stop()

bool set_max_updated_index_on_stop ( Slave_worker worker,
Slave_job_item job_item 
)

This function is called by both coordinator and workers.

Both coordinator and workers contribute to max_updated_index.

Parameters
workera pointer to the waiting Worker struct
job_itema pointer to struct carrying a reference to an event
Returns
true if STOP command gets accepted otherwise false is returned.

◆ slave_worker_exec_job_group()

int slave_worker_exec_job_group ( Slave_worker worker,
Relay_log_info rli 
)

apply one job group.

Note
the function maintains worker's CGEP and modifies APH, updates the current group item in GAQ via slave_worker_ends_group().

param[in] worker the worker which calls it. param[in] rli slave's relay log info object.

return returns 0 if the group of jobs are applied successfully, otherwise returns an error code.

Variable Documentation

◆ w_rr

ulong w_rr
extern