#include <certification_handler.h>
|
int | set_transaction_context (Pipeline_event *pevent) |
| Set transaction context for next event handler. More...
|
|
int | get_transaction_context (Pipeline_event *pevent, Transaction_context_log_event **tcle) |
| Get transaction context set on previous event handler. More...
|
|
void | reset_transaction_context () |
| Reset transaction context. More...
|
|
int | handle_transaction_context (Pipeline_event *pevent, Continuation *cont) |
| This method handles transaction context events by storing them so they can be used on next handler. More...
|
|
int | handle_binary_log_event (Pipeline_event *pevent, Continuation *cont) |
| This method handles binary log events by storing them so they can be used on next handler. More...
|
|
int | handle_applier_event (Pipeline_event *pevent, Continuation *cont) |
| This method handles applier context events by storing them so they can be used on next handler. More...
|
|
int | handle_applier_view_change_packet (Pipeline_event *pevent, Continuation *cont) |
| This method handles applier view change packet. More...
|
|
int | handle_recovery_metadata (Pipeline_event *pevent, Continuation *cont) |
| This method saves the recovery metadata. More...
|
|
int | handle_view_change_packet_without_vcle (Pipeline_event *pevent, Continuation *cont) |
| If VC is delayed this method pushes the metadata for later processing else it processes the VC Packet. More...
|
|
int | handle_transaction_id (Pipeline_event *pevent, Continuation *cont) |
| This methods handles transaction identifier events, it does two tasks: More...
|
|
int | extract_certification_info (Pipeline_event *pevent, Continuation *cont) |
|
int | inject_transactional_events (Pipeline_event *pevent, Gtid gtid, binlog::BgcTicket::ValueType bgc_ticket, Continuation *cont) |
| Create a transactional block for the received log event GTID BEGIN EVENT COMMIT. More...
|
|
int | log_view_change_event_in_order (Pipeline_event *view_pevent, Continuation *cont) |
| Try to log a view change event waiting for local certified transactions to finish. More...
|
|
binlog::BgcTicket::ValueType | generate_view_change_bgc_ticket () |
| Generate a commit order ticket for the View_change transaction. More...
|
|
binlog::BgcTicket::ValueType | increment_bgc_ticket () |
| Increment a commit order ticket for the View_change transaction. More...
|
|
◆ Certification_handler()
Certification_handler::Certification_handler |
( |
| ) |
|
◆ ~Certification_handler()
Certification_handler::~Certification_handler |
( |
| ) |
|
|
override |
◆ extract_certification_info()
◆ generate_view_change_bgc_ticket()
Generate a commit order ticket for the View_change transaction.
More precisely it will: 1) increment the current ticket so that the all transactions ordered before view will have a ticket smaller than the one assigned to the view. 2) generate the ticket for the view. 3) increment again the current ticket so that all transactions ordered after the view will have a ticket greater that the one assigned to the view.
- Returns
- the ticket generated for the view
◆ get_certifier()
◆ get_role()
int Certification_handler::get_role |
( |
| ) |
|
|
overridevirtual |
This method returns the handler role.
Handlers can have different roles according to the tasks they represent. Is based on this role that certain components can extract and interact with pipeline handlers. This means that if a role is given to a singleton handler, no one else can have that role.
- Returns
- the handler role
Implements Event_handler.
◆ get_transaction_context()
Get transaction context set on previous event handler.
- Parameters
-
[in] | pevent | Pipeline event that wraps Gtid_log_event. |
[out] | tcle | Transaction_context_log_event. |
- Returns
- Operation status
- Return values
-
◆ handle_action()
Handling of an action as defined in the handler implementation.
As the handler can be included in a pipeline, somewhere in the method, the handler.next(action) method shall be invoked to allow the passing of the action to the next handler.
- Note
- Actions should not be treated asynchronously and as so, Continuations are not used here. Errors are returned directly or passed by in the action if it includes support for such
- Parameters
-
[in] | action | the pipeline event to be handled |
Implements Event_handler.
◆ handle_applier_event()
This method handles applier context events by storing them so they can be used on next handler.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ handle_applier_view_change_packet()
This method handles applier view change packet.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ handle_binary_log_event()
This method handles binary log events by storing them so they can be used on next handler.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ handle_event()
Handling of an event as defined in the handler implementation.
As the handler can be included in a pipeline, somewhere in the method, the handler.next(event,continuation) method shall be invoked to allow the passing of the event to the next handler.
Also, if an error occurs, the continuation object shall be used to propagate such error. This class can also be used to know/report when the transaction to whom the event belongs was discarded.
- Parameters
-
[in] | event | the pipeline event to be handled |
[in,out] | continuation | termination notification object. |
Implements Event_handler.
◆ handle_recovery_metadata()
This method saves the recovery metadata.
It needs to be stored because if metadata sender crashes another member need to send the metadata. If member is the sender, this method also initiate the metadata send request.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ handle_transaction_context()
This method handles transaction context events by storing them so they can be used on next handler.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ handle_transaction_id()
This methods handles transaction identifier events, it does two tasks:
- Using transaction context previously processed and stored, validate that this transaction does not conflict with any other;
- If the transaction does not conflict and it is allowed to commit, it does inform the server of that decision and does update the transaction identifier if needed.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ handle_view_change_packet_without_vcle()
If VC is delayed this method pushes the metadata for later processing else it processes the VC Packet.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
◆ increment_bgc_ticket()
Increment a commit order ticket for the View_change transaction.
More precisely it will: 1) NOT generate the ticket for the view. 2) increment the current ticket so that all transactions ordered after the view will have a ticket greater that the one assigned to the view.
◆ initialize()
int Certification_handler::initialize |
( |
| ) |
|
|
overridevirtual |
Initialization as defined in the handler implementation.
- Note
- It's up to the developer to decide its own initialization strategy, but the suggested approach is to initialize basic structures here and then depend on Action packets to configure and start existing handler routines.
Implements Event_handler.
◆ inject_transactional_events()
Create a transactional block for the received log event GTID BEGIN EVENT COMMIT.
- Parameters
-
[in] | pevent | the event to be injected |
[in] | gtid | The transaction GTID If {-1, -1}, one will be generated. |
[in] | bgc_ticket | The commit ticket order for this transaction on the binlog group commit. If 0, one will be generated. |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
The original_commit_timestamp for this GTID will be different for each member that generated this View_change_event.
◆ is_unique()
bool Certification_handler::is_unique |
( |
| ) |
|
|
overridevirtual |
This method identifies the handler as being unique.
An handler that is defined as unique is an handler that cannot be used more than once in a pipeline. Such tasks as certification and event application can only be done once. Unique handlers are also the only that, by being one of a kind, can be extracted during the pipeline life allowing dynamic changes to them.
- Returns
- if the handler is the a unique handler
- Return values
-
true | is a unique handler |
false | is a repeatable handler |
Implements Event_handler.
◆ log_view_change_event_in_order()
Try to log a view change event waiting for local certified transactions to finish.
- Parameters
-
[in] | view_pevent | the event to be injected |
[in] | cont | the object used to wait |
- Returns
- the operation status
- Return values
-
Create a transactional block for the View change log event GTID BEGIN VCLE COMMIT
◆ reset_transaction_context()
void Certification_handler::reset_transaction_context |
( |
| ) |
|
|
private |
Reset transaction context.
◆ set_transaction_context()
int Certification_handler::set_transaction_context |
( |
Pipeline_event * |
pevent | ) |
|
|
private |
Set transaction context for next event handler.
- Parameters
-
[in] | pevent | Pipeline event that wraps Transaction_context_log_event. |
- Returns
- Operation status
- Return values
-
◆ terminate()
int Certification_handler::terminate |
( |
| ) |
|
|
overridevirtual |
Terminate the execution as defined in the handler implementation.
Implements Event_handler.
◆ applier_module_thd
THD* Certification_handler::applier_module_thd |
|
private |
◆ cert_module
Certifier* Certification_handler::cert_module |
|
private |
◆ group_sidno
◆ pending_view_change_events_waiting_for_consistent_transactions
std::list<std::unique_ptr<View_change_stored_info> > Certification_handler::pending_view_change_events_waiting_for_consistent_transactions |
|
private |
All the VC events pending application due to consistent transactions.
◆ transaction_context_packet
Data_packet* Certification_handler::transaction_context_packet |
|
private |
◆ transaction_context_pevent
The documentation for this class was generated from the following files: