MySQL 8.0.39
Source Code Documentation
|
Group Assigned Queue whose first element identifies first gap in committed sequence. More...
#include <rpl_rli_pdb.h>
Public Member Functions | |
void | update_current_binlog (const char *post_rotate) |
Slave_committed_queue (size_t max, uint n) | |
~Slave_committed_queue () | |
bool | count_done (Relay_log_info *rli) |
size_t | move_queue_head (Slave_worker_array *ws) |
The queue is processed from the head item by item to purge items representing committed groups. More... | |
void | free_dynamic_items () |
Method should be executed at slave system stop to cleanup dynamically allocated items that remained as unprocessed by Coordinator and Workers in their regular execution course. More... | |
Slave_job_group * | get_job_group (size_t ind) |
size_t | en_queue (Slave_job_group *item) |
Assigns assigned_group_index to an index of enqueued item and returns it. More... | |
bool | de_queue (Slave_job_group *item) |
Dequeue from head. More... | |
bool | de_tail (Slave_job_group *item) |
Similar to de_queue() but removing an item from the tail side. More... | |
size_t | find_lwm (Slave_job_group **, size_t) |
Finds low-water mark of committed jobs in GAQ. More... | |
Public Member Functions inherited from circular_buffer_queue< Slave_job_group > | |
circular_buffer_queue (size_t max) | |
circular_buffer_queue () | |
~circular_buffer_queue ()=default | |
bool | de_queue (Slave_job_group *item) |
Content of the being dequeued item is copied to the arg-pointer location. More... | |
bool | de_tail (Slave_job_group *item) |
Similar to de_queue but extracting happens from the tail side. More... | |
size_t | en_queue (Slave_job_group *item) |
return the index where the arg item locates or an error encoded as a value circular_buffer_queue::error_result . More... | |
Slave_job_group * | head_queue () |
return the value of data member of the head of the queue. More... | |
bool | in (size_t i) |
size_t | get_length () const |
bool | empty () const |
bool | full () const |
Public Attributes | |
bool | inited |
Slave_job_group | lwm |
Prealloced_array< ulonglong, 1 > | last_done |
ulong | assigned_group_index |
Public Attributes inherited from circular_buffer_queue< Slave_job_group > | |
Prealloced_array< Slave_job_group, 1 > | m_Q |
size_t | capacity |
The capacity and maximum length of the queue in terms of element. More... | |
size_t | avail |
Its value modulo capacity is index of the element where the next element will be enqueued. More... | |
size_t | entry |
The head index of the queue. More... | |
std::atomic< size_t > | len |
Actual length. More... | |
bool | inited_queue |
Additional Inherited Members | |
Static Public Attributes inherited from circular_buffer_queue< Slave_job_group > | |
static constexpr size_t | error_result |
Group Assigned Queue whose first element identifies first gap in committed sequence.
The head of the queue is therefore next to the low-water-mark.
Slave_committed_queue::Slave_committed_queue | ( | size_t | max, |
uint | n | ||
) |
|
inline |
bool Slave_committed_queue::count_done | ( | Relay_log_info * | rli | ) |
|
inline |
Dequeue from head.
[out] | item | A pointer to the being dequeued item. |
|
inline |
Similar to de_queue() but removing an item from the tail side.
[out] | item | A pointer to the being dequeued item. |
|
inline |
Assigns assigned_group_index
to an index of enqueued item and returns it.
size_t Slave_committed_queue::find_lwm | ( | Slave_job_group ** | arg_g, |
size_t | start_index | ||
) |
Finds low-water mark of committed jobs in GAQ.
That is an index below which all jobs are marked as done.
Notice the first available index is returned when the queue does not have any incomplete jobs. That includes cases of the empty and the full of complete jobs queue. A mutex protecting from concurrent LWM change by move_queue_head() (by Coordinator) should be taken by the caller.
[out] | arg_g | a double pointer to Slave job descriptor item last marked with done-as-true boolean. |
start_index | a GAQ index to start/resume searching. Caller is to make sure the index points into assigned (occupied) range of circular buffer of GAQ. |
void Slave_committed_queue::free_dynamic_items | ( | ) |
Method should be executed at slave system stop to cleanup dynamically allocated items that remained as unprocessed by Coordinator and Workers in their regular execution course.
|
inline |
size_t Slave_committed_queue::move_queue_head | ( | Slave_worker_array * | ws | ) |
The queue is processed from the head item by item to purge items representing committed groups.
Progress in GAQ is assessed through comparison of GAQ index value with Worker's last_group_done_index
. Purging breaks at a first discovered gap, that is an item that the assigned item->w_id'th Worker has not yet completed.
The caller is supposed to be the checkpoint handler.
A copy of the last discarded item containing the refreshed value of the committed low-water-mark is stored into lwm
container member for further caller's processing. last_done
is updated with the latest total_seqno for each Worker that was met during GAQ parse.
void Slave_committed_queue::update_current_binlog | ( | const char * | post_rotate | ) |
ulong Slave_committed_queue::assigned_group_index |
bool Slave_committed_queue::inited |
Prealloced_array<ulonglong, 1> Slave_committed_queue::last_done |
Slave_job_group Slave_committed_queue::lwm |