MySQL 8.0.40
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
50 std::atomic<bool> plugin_is_stopping;
51 std::atomic<bool> group_replication_running;
52 std::atomic<bool> group_replication_cloning;
53
69 // The first argument indicates whether or not to use the value stored in this
70 // pair's second argument for the group_replication_paxos_single_leader sysvar
71 // or the actual value that's stored on the sysvar
72 std::pair<bool, bool> allow_single_leader_latch{false, true};
73
74 // (60min / 5min) * 24 * 7, i.e. a week.
77
79 SERVICE_TYPE(registry) * reg_srv;
80
81 /*
82 Initialize all variables, except mutexes.
83 */
84 void init() {
85 plugin_info_ptr = nullptr;
87 group_sidno = 0;
89
90 online_wait_mutex = nullptr;
91 plugin_running_lock = nullptr;
92 plugin_stop_lock = nullptr;
93 plugin_is_stopping = false;
96
100 known_server_reset = false;
111 allow_single_leader_latch.first = false;
113 // the default is 5 minutes (300 secs).
114 rejoin_timeout = 300ULL;
115
116 auto_increment_handler = nullptr;
117 reg_srv = nullptr;
118 }
119};
120
121/*
122 Options variables that have file context on plugin.cc
123
124 All *_var variables declared on this structure, are initialized
125 on plugin install when server creates the options.
126
127 Variables are listed on the same order as plugin.cc
128*/
130 const char *ssl_fips_mode_values[4] = {"OFF", "ON", "STRICT",
131 (const char *)nullptr};
132
133 const char *bool_type_allowed_values[3] = {"OFF", "ON",
134 (const char *)nullptr};
135 TYPELIB plugin_bool_typelib_t = {2, "bool_type_typelib_t",
136 bool_type_allowed_values, nullptr};
137
145
146#define DEFAULT_MEMBER_EXPEL_TIMEOUT 5
147#define MAX_MEMBER_EXPEL_TIMEOUT 3600
148#define MIN_MEMBER_EXPEL_TIMEOUT 0
150
151 // Option map entries that map the different SSL options to integer
152 static const int RECOVERY_SSL_CA_OPT = 1;
153 static const int RECOVERY_SSL_CAPATH_OPT = 2;
154 static const int RECOVERY_SSL_CERT_OPT = 3;
155 static const int RECOVERY_SSL_CIPHER_OPT = 4;
156 static const int RECOVERY_SSL_KEY_OPT = 5;
157 static const int RECOVERY_SSL_CRL_OPT = 6;
158 static const int RECOVERY_SSL_CRLPATH_OPT = 7;
160 static const int RECOVERY_TLS_VERSION_OPT = 9;
161 static const int RECOVERY_TLS_CIPHERSUITES_OPT = 10;
162 // The option map <SSL var_name, SSL var code>
163 std::map<const char *, int> recovery_ssl_opt_map;
164
182
183 const char *recovery_policies[3] = {"TRANSACTIONS_CERTIFIED",
184 "TRANSACTIONS_APPLIED", (char *)nullptr};
185 TYPELIB recovery_policies_typelib_t = {2, "recovery_policies_typelib_t",
186 recovery_policies, nullptr};
188
190
192
193 /*
194 The default value for auto_increment_increment is chosen taking into
195 account the maximum usable values for each possible auto_increment_increment
196 and what is a normal group expected size.
197 */
198#define DEFAULT_AUTO_INCREMENT_INCREMENT 7
199#define MIN_AUTO_INCREMENT_INCREMENT 1
200#define MAX_AUTO_INCREMENT_INCREMENT 65535
202
203#define DEFAULT_COMPRESSION_THRESHOLD 1000000
204#define MAX_COMPRESSION_THRESHOLD UINT_MAX32
205#define MIN_COMPRESSION_THRESHOLD 0
207
208#define DEFAULT_GTID_ASSIGNMENT_BLOCK_SIZE 1000000
209#define MIN_GTID_ASSIGNMENT_BLOCK_SIZE 1
210#define MAX_GTID_ASSIGNMENT_BLOCK_SIZE GNO_END
212
213 const char *ssl_mode_values[5] = {"DISABLED", "REQUIRED", "VERIFY_CA",
214 "VERIFY_IDENTITY", (char *)nullptr};
215 TYPELIB ssl_mode_values_typelib_t = {4, "ssl_mode_values_typelib_t",
216 ssl_mode_values, nullptr};
218
219#define IP_ALLOWLIST_STR_BUFFER_LENGTH 1024
222
223#define DEFAULT_COMMUNICATION_MAX_MESSAGE_SIZE 10485760
224#define MAX_COMMUNICATION_MAX_MESSAGE_SIZE get_max_replica_max_allowed_packet()
225#define MIN_COMMUNICATION_MAX_MESSAGE_SIZE 0
227
228#define DEFAULT_MESSAGE_CACHE_SIZE 1073741824
229#define MIN_MESSAGE_CACHE_SIZE 134217728
230#define MAX_MESSAGE_CACHE_SIZE ULONG_MAX
232
235
236 const char *flow_control_mode_values[3] = {"DISABLED", "QUOTA",
237 (const char *)nullptr};
238 TYPELIB flow_control_mode_typelib_t = {2, "flow_control_mode_typelib_t",
239 flow_control_mode_values, nullptr};
241#define DEFAULT_FLOW_CONTROL_THRESHOLD 25000
242#define MAX_FLOW_CONTROL_THRESHOLD INT_MAX32
243#define MIN_FLOW_CONTROL_THRESHOLD 0
246
247#define DEFAULT_TRANSACTION_SIZE_LIMIT 150000000
248#define MAX_TRANSACTION_SIZE_LIMIT 2147483647
249#define MIN_TRANSACTION_SIZE_LIMIT 0
250 /** Base variable that feeds the value to an atomic variable */
252 std::atomic<ulong> transaction_size_limit_var;
253
255
256 const char *exit_state_actions[4] = {"READ_ONLY", "ABORT_SERVER",
257 "OFFLINE_MODE", (char *)nullptr};
258 TYPELIB exit_state_actions_typelib_t = {3, "exit_state_actions_typelib_t",
259 exit_state_actions, nullptr};
261
263
265
266#define DEFAULT_MEMBER_WEIGHT 50
267#define MAX_MEMBER_WEIGHT 100
268#define MIN_MEMBER_WEIGHT 0
270
278
280
282
283 const char *tls_source_values[3] = {"MYSQL_MAIN", "MYSQL_ADMIN",
284 (char *)nullptr};
285 TYPELIB tls_source_values_typelib_t = {2, "tls_source_typelib_t",
286 tls_source_values, nullptr};
288
290
291 const char *communication_stack_source_values[3] = {"XCOM", "MYSQL",
292 (char *)nullptr};
294 2, "communication_stack_typelib_t", communication_stack_source_values,
295 nullptr};
297
299};
300
301#endif /* PLUGIN_VARIABLES_INCLUDE */
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:309
Definition: auto_increment.h:38
Definition: plugin_utils.h:796
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:142
@ WAIT_ON_START_PROCESS_SUCCESS
Definition: plugin.h:143
int rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:96
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:62
bool wait_on_engine_initialization
Definition: plugin_variables.h:65
mysql_cond_t plugin_online_condition
Definition: plugin_variables.h:46
void init()
Definition: plugin_variables.h:84
mysql_mutex_t force_members_running_mutex
Definition: plugin_variables.h:42
bool known_server_reset
Definition: plugin_variables.h:57
MYSQL_PLUGIN plugin_info_ptr
Definition: plugin_variables.h:37
const uint MAX_AUTOREJOIN_TRIES
Definition: plugin_variables.h:75
std::atomic< bool > group_replication_running
Definition: plugin_variables.h:51
bool plugin_is_auto_starting_on_boot
Definition: plugin_variables.h:59
Checkable_rwlock * plugin_running_lock
Definition: plugin_variables.h:48
mysql_mutex_t plugin_applier_module_initialize_terminate_mutex
Definition: plugin_variables.h:45
uint gr_lower_case_table_names
Definition: plugin_variables.h:55
Checkable_rwlock * plugin_stop_lock
Definition: plugin_variables.h:49
bool force_members_running
Definition: plugin_variables.h:54
bool plugin_is_being_uninstalled
Definition: plugin_variables.h:61
bool group_member_mgr_configured
Definition: plugin_variables.h:58
bool gr_default_table_encryption
Definition: plugin_variables.h:56
int write_set_extraction_algorithm
Definition: plugin_variables.h:66
bool plugin_is_auto_starting_on_install
Definition: plugin_variables.h:60
mysql_mutex_t plugin_modules_termination_mutex
Definition: plugin_variables.h:44
unsigned int plugin_version
Definition: plugin_variables.h:38
bool plugin_is_waiting_to_set_server_read_mode
Definition: plugin_variables.h:63
rpl_sidno group_sidno
Definition: plugin_variables.h:39
ulonglong rejoin_timeout
Definition: plugin_variables.h:76
Plugin_waitlock * online_wait_mutex
Definition: plugin_variables.h:47
std::atomic< bool > plugin_is_stopping
Definition: plugin_variables.h:50
bool recovery_timeout_issue_on_stop
Definition: plugin_variables.h:68
rpl_sidno view_change_sidno
Definition: plugin_variables.h:40
std::atomic< bool > group_replication_cloning
Definition: plugin_variables.h:52
Plugin_group_replication_auto_increment * auto_increment_handler
Definition: plugin_variables.h:78
mysql_mutex_t plugin_online_mutex
Definition: plugin_variables.h:43
SERVICE_TYPE(registry) *reg_srv
bool server_shutdown_status
Definition: plugin_variables.h:64
std::pair< bool, bool > allow_single_leader_latch
Definition: plugin_variables.h:72
enum_wait_on_start_process_result wait_on_start_process
Definition: plugin_variables.h:67
Definition: plugin_variables.h:129
char * communication_debug_options_var
Definition: plugin_variables.h:254
ulong recovery_completion_policy_var
Definition: plugin_variables.h:187
char * recovery_ssl_ca_var
Definition: plugin_variables.h:168
static const int RECOVERY_SSL_PUBLIC_KEY_PATH_OPT
Definition: plugin_variables.h:159
ulong member_expel_timeout_var
Definition: plugin_variables.h:149
char * recovery_public_key_path_var
Definition: plugin_variables.h:176
ulong compression_threshold_var
Definition: plugin_variables.h:206
char * recovery_tls_ciphersuites_var
Definition: plugin_variables.h:181
ulong transaction_size_limit_base_var
Base variable that feeds the value to an atomic variable.
Definition: plugin_variables.h:251
ulong exit_state_action_var
Definition: plugin_variables.h:260
bool bootstrap_group_var
Definition: plugin_variables.h:143
char * group_name_var
Definition: plugin_variables.h:138
char * recovery_ssl_crl_var
Definition: plugin_variables.h:173
ulong tls_source_var
Definition: plugin_variables.h:287
char * force_members_var
Definition: plugin_variables.h:142
TYPELIB recovery_policies_typelib_t
Definition: plugin_variables.h:185
uint autorejoin_tries_var
Definition: plugin_variables.h:262
std::atomic< ulong > transaction_size_limit_var
Definition: plugin_variables.h:252
static const int RECOVERY_SSL_CRLPATH_OPT
Definition: plugin_variables.h:158
char * group_seeds_var
Definition: plugin_variables.h:141
long flow_control_certifier_threshold_var
Definition: plugin_variables.h:244
ulong message_cache_size_var
Definition: plugin_variables.h:231
const char * communication_stack_source_values[3]
Definition: plugin_variables.h:291
bool allow_single_leader_var
Definition: plugin_variables.h:298
char * recovery_ssl_key_var
Definition: plugin_variables.h:172
static const int RECOVERY_SSL_CERT_OPT
Definition: plugin_variables.h:154
ulong recovery_reconnect_interval_var
Definition: plugin_variables.h:166
TYPELIB communication_stack_values_typelib_t
Definition: plugin_variables.h:293
long flow_control_max_quota_var
Definition: plugin_variables.h:273
bool allow_local_lower_version_join_var
Definition: plugin_variables.h:191
long flow_control_min_recovery_quota_var
Definition: plugin_variables.h:272
bool recovery_get_public_key_var
Definition: plugin_variables.h:177
const char * recovery_policies[3]
Definition: plugin_variables.h:183
ulong components_stop_timeout_var
Definition: plugin_variables.h:189
char * ip_whitelist_var
Definition: plugin_variables.h:220
ulong communication_max_message_size_var
Definition: plugin_variables.h:226
TYPELIB flow_control_mode_typelib_t
Definition: plugin_variables.h:238
int flow_control_release_percent_var
Definition: plugin_variables.h:277
uint member_weight_var
Definition: plugin_variables.h:269
char * recovery_tls_version_var
Definition: plugin_variables.h:180
ulong poll_spin_loops_var
Definition: plugin_variables.h:144
static const int RECOVERY_SSL_CRL_OPT
Definition: plugin_variables.h:157
int flow_control_period_var
Definition: plugin_variables.h:275
const char * bool_type_allowed_values[3]
Definition: plugin_variables.h:133
static const int RECOVERY_SSL_CIPHER_OPT
Definition: plugin_variables.h:155
char * view_change_uuid_var
Definition: plugin_variables.h:289
char * advertise_recovery_endpoints_var
Definition: plugin_variables.h:281
bool single_primary_mode_var
Definition: plugin_variables.h:233
ulonglong clone_threshold_var
Definition: plugin_variables.h:279
std::map< const char *, int > recovery_ssl_opt_map
Definition: plugin_variables.h:163
ulong flow_control_mode_var
Definition: plugin_variables.h:240
bool enforce_update_everywhere_checks_var
Definition: plugin_variables.h:234
long flow_control_min_quota_var
Definition: plugin_variables.h:271
char * ip_allowlist_var
Definition: plugin_variables.h:221
bool start_group_replication_at_boot_var
Definition: plugin_variables.h:139
ulong auto_increment_increment_var
Definition: plugin_variables.h:201
ulonglong gtid_assignment_block_size_var
Definition: plugin_variables.h:211
const char * ssl_mode_values[5]
Definition: plugin_variables.h:213
uint recovery_zstd_compression_level_var
Definition: plugin_variables.h:179
static const int RECOVERY_SSL_KEY_OPT
Definition: plugin_variables.h:156
char * local_address_var
Definition: plugin_variables.h:140
char * recovery_ssl_crlpath_var
Definition: plugin_variables.h:174
bool recovery_use_ssl_var
Definition: plugin_variables.h:167
static const int RECOVERY_TLS_VERSION_OPT
Definition: plugin_variables.h:160
char * recovery_ssl_capath_var
Definition: plugin_variables.h:169
int flow_control_hold_percent_var
Definition: plugin_variables.h:276
TYPELIB ssl_mode_values_typelib_t
Definition: plugin_variables.h:215
long flow_control_applier_threshold_var
Definition: plugin_variables.h:245
const char * tls_source_values[3]
Definition: plugin_variables.h:283
char * recovery_compression_algorithm_var
Definition: plugin_variables.h:178
int flow_control_member_quota_percent_var
Definition: plugin_variables.h:274
const char * exit_state_actions[4]
Definition: plugin_variables.h:256
ulong timeout_on_unreachable_var
Definition: plugin_variables.h:264
ulong recovery_retry_count_var
Definition: plugin_variables.h:165
ulong ssl_mode_var
Definition: plugin_variables.h:217
static const int RECOVERY_SSL_CAPATH_OPT
Definition: plugin_variables.h:153
bool recovery_ssl_verify_server_cert_var
Definition: plugin_variables.h:175
static const int RECOVERY_TLS_CIPHERSUITES_OPT
Definition: plugin_variables.h:161
static const int RECOVERY_SSL_CA_OPT
Definition: plugin_variables.h:152
TYPELIB tls_source_values_typelib_t
Definition: plugin_variables.h:285
ulong communication_stack_var
Definition: plugin_variables.h:296
char * recovery_ssl_cipher_var
Definition: plugin_variables.h:171
TYPELIB exit_state_actions_typelib_t
Definition: plugin_variables.h:258
TYPELIB plugin_bool_typelib_t
Definition: plugin_variables.h:135
const char * flow_control_mode_values[3]
Definition: plugin_variables.h:236
char * recovery_ssl_cert_var
Definition: plugin_variables.h:170
const char * ssl_fips_mode_values[4]
Definition: plugin_variables.h:130
@ HASH_ALGORITHM_OFF
Definition: system_variables.h:85
static const mysql_service_registry_t * reg_srv
Initialize parameters required for error logging.
Definition: test_plugin.cc:62
unsigned int uint
Definition: uca9-dump.cc:75