MySQL  8.0.17
Source Code Documentation
Slave_committed_queue Class Reference

Group Assigned Queue whose first element identifies first gap in committed sequence. More...

#include <rpl_rli_pdb.h>

Inheritance diagram for Slave_committed_queue:
circular_buffer_queue< Slave_job_group >

Public Member Functions

void update_current_binlog (const char *post_rotate)
 
 Slave_committed_queue (ulong max, uint n)
 
 ~Slave_committed_queue ()
 
bool count_done (Relay_log_info *rli)
 
ulong 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_groupget_job_group (ulong ind)
 
ulong en_queue (Slave_job_group *item)
 Assignes assigned_group_index to an index of enqueued item and returns it. More...
 
ulong de_queue (Slave_job_group *item)
 Dequeue from head. More...
 
ulong de_tail (Slave_job_group *item)
 Similar to de_queue() but removing an item from the tail side. More...
 
ulong find_lwm (Slave_job_group **, ulong)
 Finds low-water mark of committed jobs in GAQ. More...
 
- Public Member Functions inherited from circular_buffer_queue< Slave_job_group >
 circular_buffer_queue (ulong max)
 
 circular_buffer_queue ()
 
 ~circular_buffer_queue ()
 
ulong de_queue (Slave_job_group *item)
 Content of the being dequeued item is copied to the arg-pointer location. More...
 
ulong de_tail (Slave_job_group *item)
 Similar to de_queue but extracting happens from the tail side. More...
 
ulong en_queue (Slave_job_group *item)
 return the index where the arg item locates or an error encoded as a value in beyond of the legacy range [0, size) (value ‘size’ is excluded). More...
 
Slave_job_grouphead_queue ()
 return the value of data member of the head of the queue. More...
 
bool gt (ulong i, ulong k)
 two index comparision to determine which of the two is ordered first. More...
 
bool in (ulong k)
 
bool empty ()
 
bool full ()
 

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
 
ulong size
 
ulong avail
 
ulong entry
 
volatile ulong len
 
bool inited_queue
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Slave_committed_queue()

Slave_committed_queue::Slave_committed_queue ( ulong  max,
uint  n 
)

◆ ~Slave_committed_queue()

Slave_committed_queue::~Slave_committed_queue ( )
inline

Member Function Documentation

◆ count_done()

bool Slave_committed_queue::count_done ( Relay_log_info rli)

◆ de_queue()

ulong Slave_committed_queue::de_queue ( Slave_job_group item)
inline

Dequeue from head.

Parameters
[out]itemA pointer to the being dequeued item.
Returns
The queue's array index that the de-queued item located at, or an error encoded in beyond the index legacy range.

◆ de_tail()

ulong Slave_committed_queue::de_tail ( Slave_job_group item)
inline

Similar to de_queue() but removing an item from the tail side.

Parameters
[out]itemA pointer to the being dequeued item.
Returns
the queue's array index that the de-queued item located at, or an error.

◆ en_queue()

ulong Slave_committed_queue::en_queue ( Slave_job_group item)
inline

Assignes assigned_group_index to an index of enqueued item and returns it.

◆ find_lwm()

ulong Slave_committed_queue::find_lwm ( Slave_job_group **  arg_g,
ulong  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.

Parameters
[out]arg_ga double pointer to Slave job descriptor item last marked with done-as-true boolean.
start_indexa GAQ index to start/resume searching. Caller is to make sure the index points into assigned (occupied) range of circular buffer of GAQ.
Returns
GAQ index of the last consecutive done job, or the GAQ size when none is found.

◆ free_dynamic_items()

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.

◆ get_job_group()

Slave_job_group* Slave_committed_queue::get_job_group ( ulong  ind)
inline

◆ move_queue_head()

ulong 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 comparision of GAQ index value with Worker's last_group_done_index. Purging breaks at a first discovered gap, that is an item that the assinged 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.

Note
dyn-allocated members of Slave_job_group such as group_relay_log_name as freed here.
Returns
number of discarded items

◆ update_current_binlog()

void Slave_committed_queue::update_current_binlog ( const char *  post_rotate)

Member Data Documentation

◆ assigned_group_index

ulong Slave_committed_queue::assigned_group_index

◆ inited

bool Slave_committed_queue::inited

◆ last_done

Prealloced_array<ulonglong, 1> Slave_committed_queue::last_done

◆ lwm

Slave_job_group Slave_committed_queue::lwm

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