28#ifndef CLONE_HANDLER_INCLUDED
29#define CLONE_HANDLER_INCLUDED
48#define CLONE_PSI_STATEMENT_COUNT 5
80 const char *remote_user,
const char *remote_passwd,
95 const char *&message);
Clone plugin handler to convenient way to.
Definition: clone_handler.h:53
static void init_xa()
Definition: clone_handler.cc:354
static void uninit_xa()
Definition: clone_handler.cc:361
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:62
static mysql_mutex_t s_xa_mutex
Mutex to synchronize blocking XA operation.
Definition: clone_handler.h:195
static std::atomic< int > s_xa_counter
Number of XA operations (prepare/commit/rollback) in progress.
Definition: clone_handler.h:182
static bool is_provisioning()
Definition: clone_handler.h:104
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:141
static bool is_data_dropped()
Definition: clone_handler.h:98
static void unblock_xa_operation()
Unblock waiting XA operations.
Definition: clone_handler.cc:468
std::string m_plugin_name
Clone plugin name.
Definition: clone_handler.h:198
static std::atomic< bool > s_xa_block_op
Set when clone blocks XA operations.
Definition: clone_handler.h:186
static std::atomic< bool > s_is_data_dropped
True, if any user data is dropped by clone.
Definition: clone_handler.h:192
Mysql_clone * m_plugin_handle
Clone plugin handle.
Definition: clone_handler.h:201
static bool block_xa_operation(THD *thd)
Block new active XA operations and wait for existing ones to complete.
Definition: clone_handler.cc:427
static void end_xa_operation()
Decrement XA operation count.
Definition: clone_handler.cc:416
int clone_local(THD *thd, const char *data_dir)
Clone handler interface for local clone.
Definition: clone_handler.cc:128
static bool need_commit_order()
Definition: clone_handler.h:108
int init()
Initialize plugin handle.
Definition: clone_handler.cc:186
int clone_remote_server(THD *thd, MYSQL_SOCKET socket)
Clone handler interface for remote clone server.
Definition: clone_handler.cc:181
static void begin_xa_operation(THD *thd)
Increment XA operation count and wait if blocked by clone.
Definition: clone_handler.cc:375
static void set_drop_data()
Must set before dropping any user data.
Definition: clone_handler.h:101
static std::atomic< int > s_provision_in_progress
True if clone provisioning in progress.
Definition: clone_handler.h:189
int validate_dir(const char *in_dir, char *out_dir)
Validate clone data directory and convert to os format.
Definition: clone_handler.cc:214
Clone_handler(const char *plugin_name_arg)
Constructor: Initialize plugin name.
Definition: clone_handler.h:56
Definition: srv_session.h:55
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
void clone_plugin_unlock(THD *thd, plugin_ref plugin)
Unlock the clone plugin.
Definition: clone_handler.cc:343
Clone_handler * clone_plugin_lock(THD *thd, plugin_ref *plugin)
Check if the clone plugin is installed and lock.
Definition: clone_handler.cc:323
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
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:270
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:62
Definition: clone_handler.h:137
bool m_success
If blocking is successful and there is no XA operations.
Definition: clone_handler.h:156
bool failed() const
Definition: clone_handler.cc:425
~XA_Block()
Destructor: unblock XA operations.
Definition: clone_handler.cc:423
XA_Block(THD *thd)
Constructor: Block all XA operations.
Definition: clone_handler.cc:418
XA_Block(XA_Block const &)=delete
Disable copy construction.
XA_Block & operator=(XA_Block const &)=delete
Disable assignment.
Definition: clone_handler.h:117
XA_Operation(THD *thd)
Constructor: mark XA operation begin.
Definition: clone_handler.cc:363
XA_Operation & operator=(XA_Operation const &)=delete
Disable assignment.
THD * m_thd
Session thread holding the guard.
Definition: clone_handler.h:133
XA_Operation(XA_Operation const &)=delete
Disable copy construction.
~XA_Operation()
Destructor: mark XA operation end.
Definition: clone_handler.cc:370
An instrumented socket.
Definition: mysql_socket_bits.h:34
The descriptor structure for the plugin, that is referred from st_mysql_plugin.
Definition: plugin_clone.h:42
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
Definition: sql_plugin_ref.h:44
unsigned int uint
Definition: uca9-dump.cc:74