开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
2 Star 0 Fork 0

万里数据库/GreatSQL-Cluster

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (2)
标签 (1)
master
greatsql-cluster-8.4.4-4
GreatSQL-Cluster-8.4.4-4
master
分支 (2)
标签 (1)
master
greatsql-cluster-8.4.4-4
GreatSQL-Cluster-8.4.4-4
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (2)
标签 (1)
master
greatsql-cluster-8.4.4-4
GreatSQL-Cluster-8.4.4-4
plugin.h 13.04 KB
一键复制 编辑 原始数据 按行查看 历史
GreatSQL 提交于 2025年11月15日 22:14 +08:00 . first commit for GreatSQL Cluster 8.4.4-4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
/* Copyright (c) 2014, 2024, Oracle and/or its affiliates.
Copyright (c) 2023, 2025, GreatDB Software Co., Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef PLUGIN_INCLUDE
#define PLUGIN_INCLUDE
#include <mysql/components/services/mysql_runtime_error_service.h>
#include <mysql/plugin.h>
#include <mysql/plugin_group_replication.h>
#include "plugin/group_replication/include/applier.h"
#include "plugin/group_replication/include/asynchronous_channels_state_observer.h"
#include "plugin/group_replication/include/auto_increment.h"
#include "plugin/group_replication/include/compatibility_module.h"
#include "plugin/group_replication/include/delayed_plugin_initialization.h"
#include "plugin/group_replication/include/gcs_event_handlers.h"
#include "plugin/group_replication/include/gcs_operations.h"
#include "plugin/group_replication/include/gcs_view_modification_notifier.h"
#include "plugin/group_replication/include/group_actions/group_action_coordinator.h"
#include "plugin/group_replication/include/plugin_constants.h"
#include "plugin/group_replication/include/plugin_handlers/group_partition_handling.h"
#include "plugin/group_replication/include/plugin_handlers/primary_election_invocation_handler.h"
#include "plugin/group_replication/include/plugin_handlers/read_mode_handler.h"
#include "plugin/group_replication/include/plugin_handlers/recovery_metadata.h"
#include "plugin/group_replication/include/plugin_handlers/remote_clone_handler.h"
#include "plugin/group_replication/include/plugin_observers/channel_observation_manager.h"
#include "plugin/group_replication/include/plugin_observers/group_event_observer.h"
#include "plugin/group_replication/include/plugin_observers/group_transaction_observation_manager.h"
#include "plugin/group_replication/include/plugin_server_include.h"
#include "plugin/group_replication/include/ps_information.h"
#include "plugin/group_replication/include/recovery.h"
#include "plugin/group_replication/include/services/message_service/message_service.h"
#include "plugin/group_replication/include/services/registry.h"
#include "plugin/group_replication/include/services/server_services_references.h"
#include "plugin/group_replication/libmysqlgcs/include/mysql/gcs/gcs_interface.h"
// Forward declarations
class Autorejoin_thread;
class Transaction_consistency_manager;
class Member_actions_handler;
class Metrics_handler;
class Consensus_leaders_handler;
class Mysql_thread;
// Definition of system var structures
// Definition of system vars structure for access their information in the
// plugin
struct SYS_VAR {
MYSQL_PLUGIN_VAR_HEADER;
};
/**
Position of channel observation manager's in channel_observation_manager_list
*/
enum enum_channel_observation_manager_position {
GROUP_CHANNEL_OBSERVATION_MANAGER_POS = 0,
ASYNC_CHANNEL_OBSERVATION_MANAGER_POS,
END_CHANNEL_OBSERVATION_MANAGER_POS
};
/**
@enum enum_exit_state_action
@brief Action performed when the member leaves the group
unexpectedly.
*/
enum enum_exit_state_action {
EXIT_STATE_ACTION_READ_ONLY = 0,
EXIT_STATE_ACTION_ABORT_SERVER,
EXIT_STATE_ACTION_OFFLINE_MODE
};
/**
@enum_mgr_fast_mode_type
@brief fast mode when performing mgr
*/
enum enum_mgr_fast_mode_type {
MGR_FAST_MODE_NEVER = 0,
MGR_FAST_MODE_WITH_PARALLEL_REPLAY,
MGR_FAST_MODE_WITHOUT_PARALLEL_REPLAY
};
enum Primary_election_mode {
PEM_WEIGHT_ONLY = 0,
PEM_GTID_FIRST,
PEM_WEIGHT_FIRST
};
/**
This struct provides a namespace for the GR layer components.
*/
struct gr_modules {
/**
@enum gr_modules_enum
@brief Represents the GR layer modules that can be initialized
and/or terminated at will while the plugin is running.
@see terminate_plugin_modules
*/
enum gr_modules_enum {
RECOVERY_MODULE = 0,
GROUP_ACTION_COORDINATOR,
PRIMARY_ELECTION_HANDLER,
AUTO_INCREMENT_HANDLER,
APPLIER_MODULE,
ASYNC_REPL_CHANNELS,
GROUP_PARTITION_HANDLER,
AUTOREJOIN_THREAD,
BLOCKED_TRANSACTION_HANDLER,
CERTIFICATION_LATCH,
GROUP_MEMBER_MANAGER,
REGISTRY_MODULE,
WAIT_ON_START,
COMPATIBILITY_MANAGER,
GCS_EVENTS_HANDLER,
REMOTE_CLONE_HANDLER,
MESSAGE_SERVICE_HANDLER,
BINLOG_DUMP_THREAD_KILL,
MEMBER_ACTIONS_HANDLER,
METRICS_HANDLER,
RECOVERY_METADATA_MODULE,
NUM_MODULES
};
using mask = std::bitset<NUM_MODULES>;
static constexpr mask all_modules = (1 << NUM_MODULES) - 1;
};
/**
@enum enum_tls_source_values
@brief Source of TLS configuration for the connection between Group
Replication members.
*/
enum enum_tls_source_values {
TLS_SOURCE_MYSQL_MAIN = 0,
TLS_SOURCE_MYSQL_ADMIN
};
/**
@enum enum_wait_on_start_process_result
@brief Reasons why asynchronous channels start wait for Group
Replication status can be aborted.
*/
enum enum_wait_on_start_process_result {
WAIT_ON_START_PROCESS_SUCCESS = 0,
WAIT_ON_START_PROCESS_ABORT_ON_CLONE,
WAIT_ON_START_PROCESS_ABORT_SECONDARY_MEMBER
};
/**
The plugin modules.
@note Whenever you want to create a new plugin module, be sure to add it to
the gr_modules enum (@sa gr_modules) and see if it's part of the rejoin
process.
*/
extern Gcs_operations *gcs_module;
extern Applier_module *applier_module;
extern Recovery_module *recovery_module;
extern Registry_module_interface *registry_module;
extern Group_member_info_manager_interface *group_member_mgr;
extern Group_events_observation_manager *group_events_observation_manager;
extern Channel_observation_manager_list *channel_observation_manager_list;
extern Asynchronous_channels_state_observer
*asynchronous_channels_state_observer;
extern Transaction_consistency_manager *transaction_consistency_manager;
// Lock for the applier and recovery module to prevent the race between STOP
// Group replication and ongoing transactions.
extern Group_transaction_observation_manager
*group_transaction_observation_manager;
extern Shared_writelock *shared_plugin_stop_lock;
extern Delayed_initialization_thread *delayed_initialization_thread;
extern Group_action_coordinator *group_action_coordinator;
extern Primary_election_handler *primary_election_handler;
extern Autorejoin_thread *autorejoin_module;
extern Message_service_handler *message_service_handler;
extern Member_actions_handler *member_actions_handler;
extern Metrics_handler *metrics_handler;
extern Mysql_thread *mysql_thread_handler;
extern Mysql_thread *mysql_thread_handler_read_only_mode;
extern Server_services_references *server_services_references_module;
extern Recovery_metadata_module *recovery_metadata_module;
// Auxiliary Functionality
extern Plugin_gcs_events_handler *events_handler;
extern Group_member_info *local_member_info;
extern Compatibility_module *compatibility_mgr;
extern Group_partition_handling *group_partition_handler;
extern Blocked_transaction_handler *blocked_transaction_handler;
extern Remote_clone_handler *remote_clone_handler;
extern Consensus_leaders_handler *consensus_leaders_handler;
// Latch used as the control point of the event driven
// management of the transactions.
extern Wait_ticket<my_thread_id> *transactions_latch;
extern SERVICE_TYPE_NO_CONST(mysql_runtime_error) * mysql_runtime_error_service;
// Plugin global methods
bool server_engine_initialized();
void *get_plugin_pointer();
Checkable_rwlock *get_plugin_running_lock();
mysql_mutex_t *get_plugin_applier_module_initialize_terminate_lock();
int initialize_plugin_and_join(enum_plugin_con_isolation sql_api_isolation,
Delayed_initialization_thread *delayed_init_thd);
int initialize_plugin_modules(gr_modules::mask modules_to_init);
int terminate_plugin_modules(gr_modules::mask modules_to_terminate,
char **error_message = nullptr,
bool rejoin = false);
void register_server_reset_master();
bool get_allow_local_lower_version_join();
ulong get_transaction_size_limit();
ulong get_request_time_threshold();
bool is_plugin_waiting_to_set_server_read_mode();
bool check_async_channel_running_on_secondary();
void set_enforce_update_everywhere_checks(bool option);
void set_single_primary_mode_var(bool option);
void set_auto_increment_handler_values();
void reset_auto_increment_handler_values(bool force_reset = false);
SERVICE_TYPE(registry) * get_plugin_registry();
rpl_sidno get_group_sidno();
rpl_sidno get_view_change_sidno();
bool is_view_change_log_event_required();
bool is_autorejoin_enabled();
uint get_number_of_autorejoin_tries();
ulonglong get_rejoin_timeout();
void declare_plugin_cloning(bool is_running);
bool get_allow_single_leader();
uint get_auto_evict_timeout();
/**
Encapsulates the logic necessary to attempt a rejoin, i.e. gracefully leave
the group, terminate GCS infrastructure, terminate auto-rejoin relevant plugin
modules, reinitialize auto-rejoin relevant plugin modules, reinitialize GCS
infrastructure and attempt to join the group again.
@returns a flag indicating success or failure.
@retval true the rejoin failed.
@retval false the rejoin succeeded.
*/
bool attempt_rejoin();
bool get_plugin_is_stopping();
bool get_wait_on_engine_initialization();
void enable_server_shutdown_status();
bool get_server_shutdown_status();
void mysql_thread_handler_finalize();
void set_plugin_is_setting_read_mode(bool value);
bool get_plugin_is_setting_read_mode();
bool get_majority_after_mode_var();
const char *get_group_name_var();
const char *get_view_change_uuid_var();
ulong get_exit_state_action_var();
ulong get_flow_control_mode_var();
ulong get_single_primary_election_mode_var();
const char *get_single_primary_election_mode_string(int index);
ulong get_certification_loop_sleep_time_var();
ulong get_certification_loop_chunk_size_var();
ulong get_xcom_ssl_socket_timeout_var();
ulong get_xcom_ssl_accept_retries_var();
long get_flow_control_certifier_threshold_var();
long get_flow_control_applier_threshold_var();
long get_flow_control_replay_lag_behind_var();
long get_flow_control_max_wait_time_var();
long get_flow_control_min_quota_var();
long get_applier_batch_size_threshold_var();
long get_flow_control_min_recovery_quota_var();
long get_flow_control_max_quota_var();
int get_flow_control_member_quota_percent_var();
int get_flow_control_period_var();
int get_flow_control_hold_percent_var();
int get_flow_control_release_percent_var();
int get_broadcast_gtid_executed_period_var();
ulong get_components_stop_timeout_var();
ulong get_communication_stack_var();
bool is_arbitrator_role();
// Plugin public methods
int plugin_group_replication_init(MYSQL_PLUGIN plugin_info);
int plugin_group_replication_deinit(void *p);
int plugin_group_replication_start(char **error_message = nullptr);
int plugin_group_replication_stop(char **error_message = nullptr);
bool plugin_is_group_replication_running();
bool plugin_is_group_replication_cloning();
bool is_plugin_auto_starting_on_non_bootstrap_member();
bool is_plugin_configured_and_starting();
enum_wait_on_start_process_result initiate_wait_on_start_process();
void terminate_wait_on_start_process(
enum_wait_on_start_process_result abort = WAIT_ON_START_PROCESS_SUCCESS);
void set_wait_on_start_process(bool cond);
bool plugin_get_connection_status(
const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS &callbacks);
bool plugin_get_group_members(
uint index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS &callbacks);
bool plugin_get_group_member_stats(
uint index,
const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS &callbacks);
uint plugin_get_group_members_number();
int plugin_group_replication_leave_group();
void plugin_unlock_waitting_transactions();
void plugin_update_zone_id_for_communication_node(const char *address,
int zone_id,
bool zone_id_sync_mode);
/**
Method to set retrieved certification info from a recovery channel extracted
from a given View_change event
@note a copy of the certification info is made here.
@param info the given view_change_event.
*/
int plugin_group_replication_set_retrieved_certification_info(void *info);
/* Method to collect status info */
void add_before_commit_request_time(uint64_t request_time);
#endif /* PLUGIN_INCLUDE */
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

GreatSQL Cluster是GreatSQL社区开源的分布式关系型数据库,具备卓越的水平扩展能力、金融级的数据一致性、秒级故障自动无损容灾能力以及完整SQL语法支持等重要特性。
取消

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/GreatSQL/GreatSQL-Cluster.git
git@gitee.com:GreatSQL/GreatSQL-Cluster.git
GreatSQL
GreatSQL-Cluster
GreatSQL-Cluster
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /