![]() |
MySQL 26.7.0
Source Code Documentation
|
Handles and operates the handled session. More...
#include <relay_context.h>
Public Member Functions | |
| Relay_context (std::size_t id, Relay_log_info *channel_config_rli) | |
| Constructor. More... | |
| virtual | ~Relay_context () |
| Destructor. More... | |
| Relay_log_info * | get_relay_log_info () |
| Obtains associated RLI pointer. More... | |
| unsigned int | get_thd_id () const |
| Obtains THD identifier. More... | |
| bool | is_valid () |
| Checks validity. More... | |
| void | attach_session () |
| Attaches to session. Must succeed. More... | |
| void | detach_session () |
| Detaches from session. More... | |
| Session & | get_session () |
| Obtains session handle. More... | |
| std::size_t | get_id () const |
| Obtains this relay context id. More... | |
| void | set_fde (Format_description_log_event *fde) |
| Sets FDE for this relay context. More... | |
| void | set_parallel_worker_context (Commit_order_manager *com, Trx_id trx_seq_num, Worker_id worker_id, const std::string &channel_id, int current_retry, int retries_num) |
| Sets parallel worker context for the next transaction. More... | |
| void | register_to_commit_order () |
| if attached to commit order manager, registers parallel worker to commit order (using parallel worker context) More... | |
| void | report_error (const std::string &trx_id) |
| Report error to parent thread. More... | |
| void | enable_stop_error_suppression_if_clean () |
| Enables stop error suppression if this context had no reported error. More... | |
| cs::apply::Csa_worker_context * | get_parallel_worker_context () |
| Obtain parallel worker context. More... | |
| void | clean () |
| Clean-up session. More... | |
| void | awake (bool force_kill) |
| Awakes sessions to faster end execution. More... | |
| void | attach_rli () |
| Attaches to RLI. More... | |
| void | detach_rli () |
| Detaches from RLI. More... | |
| void | retry_transaction (int current_count, bool skip_rollback) |
| Prepares context for retry. More... | |
| bool | wait_for_rollback () |
| Waits for external parallel context rollback. More... | |
| bool | can_be_retried () |
| Check if handled context can be retried. More... | |
Private Attributes | |
| std::unique_ptr< Relay_log_info > | m_rli |
| A pointer to the relay context. More... | |
| Session | m_session |
| Session. More... | |
| bool | m_attached {false} |
| Flag indicating whether this session is currently attached to CSA worker. More... | |
| Commit_order_manager * | m_commit_order_manager {nullptr} |
| Commit order manager. More... | |
| Relay_log_info * | m_channel_config_rli {nullptr} |
| Parent channel configuration RLI. More... | |
| std::size_t | m_id {0} |
| This relay context identifier. More... | |
| std::unique_ptr< Csa_worker_context > | m_csa_worker_context |
| Pointer to CSA worker context. More... | |
Handles and operates the handled session.
| using mysql::csa::Relay_context::Parallel_worker_context_ptr = cs::apply::Parallel_worker_context_ptr |
| mysql::csa::Relay_context::Relay_context | ( | std::size_t | id, |
| Relay_log_info * | channel_config_rli | ||
| ) |
Constructor.
| id | This relay context id |
| channel_config_rli | Channel configuration RLI |
|
virtual |
Destructor.
| void mysql::csa::Relay_context::attach_rli | ( | ) |
Attaches to RLI.
| void mysql::csa::Relay_context::attach_session | ( | ) |
Attaches to session. Must succeed.
| void mysql::csa::Relay_context::awake | ( | bool | force_kill | ) |
Awakes sessions to faster end execution.
| force_kill | When true, kills THDs |
| bool mysql::csa::Relay_context::can_be_retried | ( | ) |
Check if handled context can be retried.
| void mysql::csa::Relay_context::clean | ( | ) |
Clean-up session.
| void mysql::csa::Relay_context::detach_rli | ( | ) |
Detaches from RLI.
| void mysql::csa::Relay_context::detach_session | ( | ) |
Detaches from session.
| void mysql::csa::Relay_context::enable_stop_error_suppression_if_clean | ( | ) |
Enables stop error suppression if this context had no reported error.
| std::size_t mysql::csa::Relay_context::get_id | ( | ) | const |
Obtains this relay context id.
| cs::apply::Csa_worker_context * mysql::csa::Relay_context::get_parallel_worker_context | ( | ) |
Obtain parallel worker context.
| Relay_log_info * mysql::csa::Relay_context::get_relay_log_info | ( | ) |
Obtains associated RLI pointer.
|
inline |
Obtains session handle.
| unsigned int mysql::csa::Relay_context::get_thd_id | ( | ) | const |
Obtains THD identifier.
| bool mysql::csa::Relay_context::is_valid | ( | void | ) |
Checks validity.
| void mysql::csa::Relay_context::register_to_commit_order | ( | ) |
if attached to commit order manager, registers parallel worker to commit order (using parallel worker context)
| void mysql::csa::Relay_context::report_error | ( | const std::string & | trx_id | ) |
Report error to parent thread.
| trx_id | Applier transaction identifier |
| void mysql::csa::Relay_context::retry_transaction | ( | int | current_count, |
| bool | skip_rollback | ||
| ) |
Prepares context for retry.
| current_count | Current retries number for this transaction |
| skip_rollback | True if we need to skip rollback (already rolled back) |
| void mysql::csa::Relay_context::set_fde | ( | Format_description_log_event * | fde | ) |
Sets FDE for this relay context.
| fde | FDE that will be used to apply transactions |
| void mysql::csa::Relay_context::set_parallel_worker_context | ( | Commit_order_manager * | com, |
| Relay_context::Trx_id | trx_seq_num, | ||
| Relay_context::Worker_id | worker_id, | ||
| const std::string & | channel_id, | ||
| int | current_retry, | ||
| int | retries_num | ||
| ) |
Sets parallel worker context for the next transaction.
| com | Current commit order manager pointer |
| trx_seq_num | Transaction sequence number |
| worker_id | Worker identifier - sequence number |
| channel_id | Channel identifier - string |
| current_retry | Current number of retries |
| retries_num | Allowed number of retries |
| bool mysql::csa::Relay_context::wait_for_rollback | ( | ) |
Waits for external parallel context rollback.
|
private |
Flag indicating whether this session is currently attached to CSA worker.
|
private |
Parent channel configuration RLI.
|
private |
Commit order manager.
|
private |
Pointer to CSA worker context.
|
private |
This relay context identifier.
|
private |
A pointer to the relay context.
It shall be a dummy context, as there is no need to store positions in tables or files, since this applier only supports GTIDs
|
private |
Session.