29#ifndef CLONE_HANDLER_INCLUDED
30#define CLONE_HANDLER_INCLUDED
49#define CLONE_PSI_STATEMENT_COUNT 5
81 const char *remote_user,
const char *remote_passwd,
96 const char *&message);
Clone plugin handler to convenient way to.
Definition: clone_handler.h:54
static void init_xa()
Definition: clone_handler.cc:355
static void uninit_xa()
Definition: clone_handler.cc:362
static bool get_donor_error(Srv_session *session, int &error, const char *&message)
Get donor error and message for ER_CLONE_DONOR error.
Definition: clone_handler.cc:63
static mysql_mutex_t s_xa_mutex
Mutex to synchronize blocking XA operation.
Definition: clone_handler.h:196
static std::atomic< int > s_xa_counter
Number of XA operations (prepare/commit/rollback) in progress.
Definition: clone_handler.h:183
static bool is_provisioning()
Definition: clone_handler.h:105
int clone_remote_client(THD *thd, const char *remote_host, uint remote_port, const char *remote_user, const char *remote_passwd, const char *data_dir, enum mysql_ssl_mode ssl_mode)
Clone handler interface for remote clone client.
Definition: clone_handler.cc:142
static bool is_data_dropped()
Definition: clone_handler.h:99
static void unblock_xa_operation()
Unblock waiting XA operations.
Definition: clone_handler.cc:469
std::string m_plugin_name
Clone plugin name.
Definition: clone_handler.h:199
static std::atomic< bool > s_xa_block_op
Set when clone blocks XA operations.
Definition: clone_handler.h:187
static std::atomic< bool > s_is_data_dropped
True, if any user data is dropped by clone.
Definition: clone_handler.h:193
Mysql_clone * m_plugin_handle
Clone plugin handle.
Definition: clone_handler.h:202
static bool block_xa_operation(THD *thd)
Block new active XA operations and wait for existing ones to complete.
Definition: clone_handler.cc:428
static void end_xa_operation()
Decrement XA operation count.
Definition: clone_handler.cc:417
int clone_local(THD *thd, const char *data_dir)
Clone handler interface for local clone.
Definition: clone_handler.cc:129
static bool need_commit_order()
Definition: clone_handler.h:109
int init()
Initialize plugin handle.
Definition: clone_handler.cc:187
int clone_remote_server(THD *thd, MYSQL_SOCKET socket)
Clone handler interface for remote clone server.
Definition: clone_handler.cc:182
static void begin_xa_operation(THD *thd)
Increment XA operation count and wait if blocked by clone.
Definition: clone_handler.cc:376
static void set_drop_data()
Must set before dropping any user data.
Definition: clone_handler.h:102
static std::atomic< int > s_provision_in_progress
True if clone provisioning in progress.
Definition: clone_handler.h:190
int validate_dir(const char *in_dir, char *out_dir)
Validate clone data directory and convert to os format.
Definition: clone_handler.cc:215
Clone_handler(const char *plugin_name_arg)
Constructor: Initialize plugin name.
Definition: clone_handler.h:57
Definition: srv_session.h:56
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
void clone_plugin_unlock(THD *thd, plugin_ref plugin)
Unlock the clone plugin.
Definition: clone_handler.cc:344
Clone_handler * clone_plugin_lock(THD *thd, plugin_ref *plugin)
Check if the clone plugin is installed and lock.
Definition: clone_handler.cc:324
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
Common #defines and includes for file and socket I/O.
This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient.
mysql_ssl_mode
Definition: mysql.h:271
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:63
Definition: clone_handler.h:138
bool m_success
If blocking is successful and there is no XA operations.
Definition: clone_handler.h:157
bool failed() const
Definition: clone_handler.cc:426
~XA_Block()
Destructor: unblock XA operations.
Definition: clone_handler.cc:424
XA_Block(THD *thd)
Constructor: Block all XA operations.
Definition: clone_handler.cc:419
XA_Block(XA_Block const &)=delete
Disable copy construction.
XA_Block & operator=(XA_Block const &)=delete
Disable assignment.
Definition: clone_handler.h:118
XA_Operation(THD *thd)
Constructor: mark XA operation begin.
Definition: clone_handler.cc:364
XA_Operation & operator=(XA_Operation const &)=delete
Disable assignment.
THD * m_thd
Session thread holding the guard.
Definition: clone_handler.h:134
XA_Operation(XA_Operation const &)=delete
Disable copy construction.
~XA_Operation()
Destructor: mark XA operation end.
Definition: clone_handler.cc:371
An instrumented socket.
Definition: mysql_socket_bits.h:35
The descriptor structure for the plugin, that is referred from st_mysql_plugin.
Definition: plugin_clone.h:43
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: sql_plugin_ref.h:45
unsigned int uint
Definition: uca9-dump.cc:75