MySQL 8.4.2
Source Code Documentation
plugin_variables.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef PLUGIN_VARIABLES_INCLUDE
25#define PLUGIN_VARIABLES_INCLUDE
26
27#include <atomic>
28#include <map>
29
30/*
31 Variables that have file context on plugin.cc
32
33 All variables declared on this structure must be initialized
34 on init() function.
35*/
38 unsigned int plugin_version;
41
49 std::atomic<bool> plugin_is_stopping;
50 std::atomic<bool> group_replication_running;
51 std::atomic<bool> group_replication_cloning;
52
66 // The first argument indicates whether or not to use the value stored in this
67 // pair's second argument for the group_replication_paxos_single_leader sysvar
68 // or the actual value that's stored on the sysvar
69 std::pair<bool, bool> allow_single_leader_latch{false, true};
70
71 // (60min / 5min) * 24 * 7, i.e. a week.
72 const uint MAX_AUTOREJOIN_TRIES = 2016;
74
76 SERVICE_TYPE(registry) * reg_srv;
77
78 /*
79 Initialize all variables, except mutexes.
80 */
81 void init() {
82 plugin_info_ptr = nullptr;
84 group_sidno = 0;
86
87 online_wait_mutex = nullptr;
88 plugin_running_lock = nullptr;
89 plugin_stop_lock = nullptr;
90 plugin_is_stopping = false;
93
96 known_server_reset = false;
106 allow_single_leader_latch.first = false;
108 // the default is 5 minutes (300 secs).
109 rejoin_timeout = 300ULL;
110
111 auto_increment_handler = nullptr;
112 reg_srv = nullptr;
113 }
114};
115
116/*
117 Options variables that have file context on plugin.cc
118
119 All *_var variables declared on this structure, are initialized
120 on plugin install when server creates the options.
121
122 Variables are listed on the same order as plugin.cc
123*/
125 const char *ssl_fips_mode_values[4] = {"OFF", "ON", "STRICT",
126 (const char *)nullptr};
127
128 const char *bool_type_allowed_values[3] = {"OFF", "ON",
129 (const char *)nullptr};
130 TYPELIB plugin_bool_typelib_t = {2, "bool_type_typelib_t",
131 bool_type_allowed_values, nullptr};
132
140
141#define DEFAULT_MEMBER_EXPEL_TIMEOUT 5
142#define MAX_MEMBER_EXPEL_TIMEOUT 3600
143#define MIN_MEMBER_EXPEL_TIMEOUT 0
145
146 // Option map entries that map the different SSL options to integer
147 static const int RECOVERY_SSL_CA_OPT = 1;
148 static const int RECOVERY_SSL_CAPATH_OPT = 2;
149 static const int RECOVERY_SSL_CERT_OPT = 3;
150 static const int RECOVERY_SSL_CIPHER_OPT = 4;
151 static const int RECOVERY_SSL_KEY_OPT = 5;
152 static const int RECOVERY_SSL_CRL_OPT = 6;
153 static const int RECOVERY_SSL_CRLPATH_OPT = 7;
155 static const int RECOVERY_TLS_VERSION_OPT = 9;
156 static const int RECOVERY_TLS_CIPHERSUITES_OPT = 10;
157 // The option map <SSL var_name, SSL var code>
158 std::map<const char *, int> recovery_ssl_opt_map;
159
177
179
181
182 /*
183 The default value for auto_increment_increment is chosen taking into
184 account the maximum usable values for each possible auto_increment_increment
185 and what is a normal group expected size.
186 */
187#define DEFAULT_AUTO_INCREMENT_INCREMENT 7
188#define MIN_AUTO_INCREMENT_INCREMENT 1
189#define MAX_AUTO_INCREMENT_INCREMENT 65535
191
192#define DEFAULT_COMPRESSION_THRESHOLD 1000000
193#define MAX_COMPRESSION_THRESHOLD UINT_MAX32
194#define MIN_COMPRESSION_THRESHOLD 0
196
197#define DEFAULT_GTID_ASSIGNMENT_BLOCK_SIZE 1000000
198#define MIN_GTID_ASSIGNMENT_BLOCK_SIZE 1
199#define MAX_GTID_ASSIGNMENT_BLOCK_SIZE GNO_END
201
202 const char *ssl_mode_values[5] = {"DISABLED", "REQUIRED", "VERIFY_CA",
203 "VERIFY_IDENTITY", (char *)nullptr};
204 TYPELIB ssl_mode_values_typelib_t = {4, "ssl_mode_values_typelib_t",
205 ssl_mode_values, nullptr};
207
208#define IP_ALLOWLIST_STR_BUFFER_LENGTH 1024
210
211#define DEFAULT_COMMUNICATION_MAX_MESSAGE_SIZE 10485760
212#define MAX_COMMUNICATION_MAX_MESSAGE_SIZE get_max_replica_max_allowed_packet()
213#define MIN_COMMUNICATION_MAX_MESSAGE_SIZE 0
215
216#define DEFAULT_MESSAGE_CACHE_SIZE 1073741824
217#define MIN_MESSAGE_CACHE_SIZE 134217728
218#define MAX_MESSAGE_CACHE_SIZE ULONG_MAX
220
223
224 const char *flow_control_mode_values[3] = {"DISABLED", "QUOTA",
225 (const char *)nullptr};
226 TYPELIB flow_control_mode_typelib_t = {2, "flow_control_mode_typelib_t",
227 flow_control_mode_values, nullptr};
229#define DEFAULT_FLOW_CONTROL_THRESHOLD 25000
230#define MAX_FLOW_CONTROL_THRESHOLD INT_MAX32
231#define MIN_FLOW_CONTROL_THRESHOLD 0
234
235#define DEFAULT_TRANSACTION_SIZE_LIMIT 150000000
236#define MAX_TRANSACTION_SIZE_LIMIT 2147483647
237#define MIN_TRANSACTION_SIZE_LIMIT 0
238 /** Base variable that feeds the value to an atomic variable */
240 std::atomic<ulong> transaction_size_limit_var;
241
243
244 const char *exit_state_actions[4] = {"READ_ONLY", "ABORT_SERVER",
245 "OFFLINE_MODE", (char *)nullptr};
246 TYPELIB exit_state_actions_typelib_t = {3, "exit_state_actions_typelib_t",
247 exit_state_actions, nullptr};
249
251
253
254#define DEFAULT_MEMBER_WEIGHT 50
255#define MAX_MEMBER_WEIGHT 100
256#define MIN_MEMBER_WEIGHT 0
258
266
268
270
271 const char *tls_source_values[3] = {"MYSQL_MAIN", "MYSQL_ADMIN",
272 (char *)nullptr};
273 TYPELIB tls_source_values_typelib_t = {2, "tls_source_typelib_t",
274 tls_source_values, nullptr};
276
278
279 const char *communication_stack_source_values[3] = {"XCOM", "MYSQL",
280 (char *)nullptr};
282 2, "communication_stack_typelib_t", communication_stack_source_values,
283 nullptr};
285
287
289
291};
292
293#endif /* PLUGIN_VARIABLES_INCLUDE */
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:324
Definition: auto_increment.h:38
Definition: plugin_utils.h:797
void * MYSQL_PLUGIN
Definition: plugin.h:82
unsigned long long int ulonglong
Definition: my_inttypes.h:56
enum_wait_on_start_process_result
Reasons why asynchronous channels start wait for Group Replication status can be aborted.
Definition: plugin.h:146
@ WAIT_ON_START_PROCESS_SUCCESS
Definition: plugin.h:147
cs::index::rpl_sidno rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:108
Definition: typelib.h:35
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: plugin_variables.h:36
bool plugin_is_setting_read_mode
Definition: plugin_variables.h:60
bool wait_on_engine_initialization
Definition: plugin_variables.h:63
mysql_cond_t plugin_online_condition
Definition: plugin_variables.h:45
void init()
Definition: plugin_variables.h:81
bool known_server_reset
Definition: plugin_variables.h:55
MYSQL_PLUGIN plugin_info_ptr
Definition: plugin_variables.h:37
const uint MAX_AUTOREJOIN_TRIES
Definition: plugin_variables.h:72
std::atomic< bool > group_replication_running
Definition: plugin_variables.h:50
bool plugin_is_auto_starting_on_boot
Definition: plugin_variables.h:57
Checkable_rwlock * plugin_running_lock
Definition: plugin_variables.h:47
mysql_mutex_t plugin_applier_module_initialize_terminate_mutex
Definition: plugin_variables.h:44
uint gr_lower_case_table_names
Definition: plugin_variables.h:53
Checkable_rwlock * plugin_stop_lock
Definition: plugin_variables.h:48
bool plugin_is_being_uninstalled
Definition: plugin_variables.h:59
bool group_member_mgr_configured
Definition: plugin_variables.h:56
bool gr_default_table_encryption
Definition: plugin_variables.h:54
bool plugin_is_auto_starting_on_install
Definition: plugin_variables.h:58
mysql_mutex_t plugin_modules_termination_mutex
Definition: plugin_variables.h:43
unsigned int plugin_version
Definition: plugin_variables.h:38
bool plugin_is_waiting_to_set_server_read_mode
Definition: plugin_variables.h:61
rpl_sidno group_sidno
Definition: plugin_variables.h:39
ulonglong rejoin_timeout
Definition: plugin_variables.h:73
Plugin_waitlock * online_wait_mutex
Definition: plugin_variables.h:46
std::atomic< bool > plugin_is_stopping
Definition: plugin_variables.h:49
bool recovery_timeout_issue_on_stop
Definition: plugin_variables.h:65
rpl_sidno view_change_sidno
Definition: plugin_variables.h:40
std::atomic< bool > group_replication_cloning
Definition: plugin_variables.h:51
Plugin_group_replication_auto_increment * auto_increment_handler
Definition: plugin_variables.h:75
mysql_mutex_t plugin_online_mutex
Definition: plugin_variables.h:42
SERVICE_TYPE(registry) *reg_srv
bool server_shutdown_status
Definition: plugin_variables.h:62
std::pair< bool, bool > allow_single_leader_latch
Definition: plugin_variables.h:69
enum_wait_on_start_process_result wait_on_start_process
Definition: plugin_variables.h:64
Definition: plugin_variables.h:124
char * communication_debug_options_var
Definition: plugin_variables.h:242
uint preemptive_garbage_collection_rows_threshold_var
Definition: plugin_variables.h:290
char * recovery_ssl_ca_var
Definition: plugin_variables.h:163
static const int RECOVERY_SSL_PUBLIC_KEY_PATH_OPT
Definition: plugin_variables.h:154
ulong member_expel_timeout_var
Definition: plugin_variables.h:144
char * recovery_public_key_path_var
Definition: plugin_variables.h:171
ulong compression_threshold_var
Definition: plugin_variables.h:195
char * recovery_tls_ciphersuites_var
Definition: plugin_variables.h:176
ulong transaction_size_limit_base_var
Base variable that feeds the value to an atomic variable.
Definition: plugin_variables.h:239
ulong exit_state_action_var
Definition: plugin_variables.h:248
bool bootstrap_group_var
Definition: plugin_variables.h:138
char * group_name_var
Definition: plugin_variables.h:133
char * recovery_ssl_crl_var
Definition: plugin_variables.h:168
ulong tls_source_var
Definition: plugin_variables.h:275
char * force_members_var
Definition: plugin_variables.h:137
uint autorejoin_tries_var
Definition: plugin_variables.h:250
std::atomic< ulong > transaction_size_limit_var
Definition: plugin_variables.h:240
static const int RECOVERY_SSL_CRLPATH_OPT
Definition: plugin_variables.h:153
char * group_seeds_var
Definition: plugin_variables.h:136
long flow_control_certifier_threshold_var
Definition: plugin_variables.h:232
ulong message_cache_size_var
Definition: plugin_variables.h:219
const char * communication_stack_source_values[3]
Definition: plugin_variables.h:279
bool allow_single_leader_var
Definition: plugin_variables.h:286
char * recovery_ssl_key_var
Definition: plugin_variables.h:167
static const int RECOVERY_SSL_CERT_OPT
Definition: plugin_variables.h:149
ulong recovery_reconnect_interval_var
Definition: plugin_variables.h:161
TYPELIB communication_stack_values_typelib_t
Definition: plugin_variables.h:281
long flow_control_max_quota_var
Definition: plugin_variables.h:261
bool allow_local_lower_version_join_var
Definition: plugin_variables.h:180
long flow_control_min_recovery_quota_var
Definition: plugin_variables.h:260
bool recovery_get_public_key_var
Definition: plugin_variables.h:172
ulong components_stop_timeout_var
Definition: plugin_variables.h:178
ulong communication_max_message_size_var
Definition: plugin_variables.h:214
TYPELIB flow_control_mode_typelib_t
Definition: plugin_variables.h:226
int flow_control_release_percent_var
Definition: plugin_variables.h:265
uint member_weight_var
Definition: plugin_variables.h:257
char * recovery_tls_version_var
Definition: plugin_variables.h:175
ulong poll_spin_loops_var
Definition: plugin_variables.h:139
static const int RECOVERY_SSL_CRL_OPT
Definition: plugin_variables.h:152
int flow_control_period_var
Definition: plugin_variables.h:263
const char * bool_type_allowed_values[3]
Definition: plugin_variables.h:128
static const int RECOVERY_SSL_CIPHER_OPT
Definition: plugin_variables.h:150
char * view_change_uuid_var
Definition: plugin_variables.h:277
char * advertise_recovery_endpoints_var
Definition: plugin_variables.h:269
bool single_primary_mode_var
Definition: plugin_variables.h:221
ulonglong clone_threshold_var
Definition: plugin_variables.h:267
std::map< const char *, int > recovery_ssl_opt_map
Definition: plugin_variables.h:158
ulong flow_control_mode_var
Definition: plugin_variables.h:228
bool enforce_update_everywhere_checks_var
Definition: plugin_variables.h:222
long flow_control_min_quota_var
Definition: plugin_variables.h:259
char * ip_allowlist_var
Definition: plugin_variables.h:209
bool start_group_replication_at_boot_var
Definition: plugin_variables.h:134
ulong auto_increment_increment_var
Definition: plugin_variables.h:190
ulonglong gtid_assignment_block_size_var
Definition: plugin_variables.h:200
const char * ssl_mode_values[5]
Definition: plugin_variables.h:202
uint recovery_zstd_compression_level_var
Definition: plugin_variables.h:174
static const int RECOVERY_SSL_KEY_OPT
Definition: plugin_variables.h:151
char * local_address_var
Definition: plugin_variables.h:135
char * recovery_ssl_crlpath_var
Definition: plugin_variables.h:169
bool recovery_use_ssl_var
Definition: plugin_variables.h:162
static const int RECOVERY_TLS_VERSION_OPT
Definition: plugin_variables.h:155
char * recovery_ssl_capath_var
Definition: plugin_variables.h:164
bool preemptive_garbage_collection_var
Definition: plugin_variables.h:288
int flow_control_hold_percent_var
Definition: plugin_variables.h:264
TYPELIB ssl_mode_values_typelib_t
Definition: plugin_variables.h:204
long flow_control_applier_threshold_var
Definition: plugin_variables.h:233
const char * tls_source_values[3]
Definition: plugin_variables.h:271
char * recovery_compression_algorithm_var
Definition: plugin_variables.h:173
int flow_control_member_quota_percent_var
Definition: plugin_variables.h:262
const char * exit_state_actions[4]
Definition: plugin_variables.h:244
ulong timeout_on_unreachable_var
Definition: plugin_variables.h:252
ulong recovery_retry_count_var
Definition: plugin_variables.h:160
ulong ssl_mode_var
Definition: plugin_variables.h:206
static const int RECOVERY_SSL_CAPATH_OPT
Definition: plugin_variables.h:148
bool recovery_ssl_verify_server_cert_var
Definition: plugin_variables.h:170
static const int RECOVERY_TLS_CIPHERSUITES_OPT
Definition: plugin_variables.h:156
static const int RECOVERY_SSL_CA_OPT
Definition: plugin_variables.h:147
TYPELIB tls_source_values_typelib_t
Definition: plugin_variables.h:273
ulong communication_stack_var
Definition: plugin_variables.h:284
char * recovery_ssl_cipher_var
Definition: plugin_variables.h:166
TYPELIB exit_state_actions_typelib_t
Definition: plugin_variables.h:246
TYPELIB plugin_bool_typelib_t
Definition: plugin_variables.h:130
const char * flow_control_mode_values[3]
Definition: plugin_variables.h:224
char * recovery_ssl_cert_var
Definition: plugin_variables.h:165
const char * ssl_fips_mode_values[4]
Definition: plugin_variables.h:125
static const mysql_service_registry_t * reg_srv
Initialize parameters required for error logging.
Definition: test_plugin.cc:62