MySQL  8.0.19
Source Code Documentation
plugin_variables.h
Go to the documentation of this file.
1 /* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
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 also distributed 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 included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef PLUGIN_VARIABLES_INCLUDE
24 #define PLUGIN_VARIABLES_INCLUDE
25 
26 #include <atomic>
27 #include <map>
28 
29 /*
30  Variables that have file context on plugin.cc
31 
32  All variables declared on this structure must be initialized
33  on init() function.
34 */
37  unsigned int plugin_version;
39 
47  std::atomic<bool> plugin_is_stopping;
48  std::atomic<bool> group_replication_running;
49  std::atomic<bool> group_replication_cloning;
51 
66 
67  // (60min / 5min) * 24 * 7, i.e. a week.
68  const uint MAX_AUTOREJOIN_TRIES = 2016;
70 
72  SERVICE_TYPE(registry) * reg_srv;
73 
74  /*
75  Initialize all variables, except mutexes.
76  */
77  void init() {
79  plugin_version = 0;
80  group_sidno = 0;
81 
84  plugin_is_stopping = false;
88 
89  force_members_running = false;
92  known_server_reset = false;
99  server_shutdown_status = false;
103  // the default is 5 minutes (300 secs).
104  rejoin_timeout = 300ULL;
105 
107  reg_srv = nullptr;
108  }
109 };
110 
111 /*
112  Options variables that have file context on plugin.cc
113 
114  All *_var variables declared on this structure, are initialized
115  on plugin install when server creates the options.
116 
117  Variables are listed on the same order as plugin.cc
118 */
120  const char *ssl_fips_mode_values[4] = {"OFF", "ON", "STRICT",
121  (const char *)0};
122 
123  const char *bool_type_allowed_values[3] = {"OFF", "ON", (const char *)0};
124  TYPELIB plugin_bool_typelib_t = {2, "bool_type_typelib_t",
126 
134 
135 #define DEFAULT_MEMBER_EXPEL_TIMEOUT 0
136 #define MAX_MEMBER_EXPEL_TIMEOUT 3600
137 #define MIN_MEMBER_EXPEL_TIMEOUT 0
139 
140  // Option map entries that map the different SSL options to integer
141  static const int RECOVERY_SSL_CA_OPT = 1;
142  static const int RECOVERY_SSL_CAPATH_OPT = 2;
143  static const int RECOVERY_SSL_CERT_OPT = 3;
144  static const int RECOVERY_SSL_CIPHER_OPT = 4;
145  static const int RECOVERY_SSL_KEY_OPT = 5;
146  static const int RECOVERY_SSL_CRL_OPT = 6;
147  static const int RECOVERY_SSL_CRLPATH_OPT = 7;
148  static const int RECOVERY_SSL_PUBLIC_KEY_PATH_OPT = 8;
149  static const int RECOVERY_TLS_VERSION_OPT = 9;
150  static const int RECOVERY_TLS_CIPHERSUITES_OPT = 10;
151  // The option map <SSL var_name, SSL var code>
152  std::map<const char *, int> recovery_ssl_opt_map;
153 
171 
172  const char *recovery_policies[3] = {"TRANSACTIONS_CERTIFIED",
173  "TRANSACTIONS_APPLIED", (char *)0};
174  TYPELIB recovery_policies_typelib_t = {2, "recovery_policies_typelib_t",
177 
179 
181 
182  /*
183  The default value for auto_increment_increment is choosen 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 MAX_GNO
201 
202  const char *ssl_mode_values[5] = {"DISABLED", "REQUIRED", "VERIFY_CA",
203  "VERIFY_IDENTITY", (char *)0};
204  TYPELIB ssl_mode_values_typelib_t = {4, "ssl_mode_values_typelib_t",
207 
208 #define IP_WHITELIST_STR_BUFFER_LENGTH 1024
210 
211 #define DEFAULT_COMMUNICATION_MAX_MESSAGE_SIZE 10485760
212 #define MAX_COMMUNICATION_MAX_MESSAGE_SIZE get_max_slave_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 DEFAULT_MESSAGE_CACHE_SIZE
218 #define MAX_MESSAGE_CACHE_SIZE ULONG_MAX
220 
223 
224  const char *flow_control_mode_values[3] = {"DISABLED", "QUOTA",
225  (const char *)0};
226  TYPELIB flow_control_mode_typelib_t = {2, "flow_control_mode_typelib_t",
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
239 
241 
242  const char *exit_state_actions[4] = {"READ_ONLY", "ABORT_SERVER",
243  "OFFLINE_MODE", (char *)0};
244  TYPELIB exit_state_actions_typelib_t = {3, "exit_state_actions_typelib_t",
247 
249 
251 
252 #define DEFAULT_MEMBER_WEIGHT 50
253 #define MAX_MEMBER_WEIGHT 100
254 #define MIN_MEMBER_WEIGHT 0
256 
264 
266 };
267 
268 #endif /* PLUGIN_VARIABLES_INCLUDE */
plugin_options_variables::recovery_policies_typelib_t
TYPELIB recovery_policies_typelib_t
Definition: plugin_variables.h:174
plugin_options_variables::poll_spin_loops_var
ulong poll_spin_loops_var
Definition: plugin_variables.h:133
plugin_local_variables::plugin_is_auto_starting_on_install
bool plugin_is_auto_starting_on_install
Definition: plugin_variables.h:58
plugin_options_variables::flow_control_min_recovery_quota_var
long flow_control_min_recovery_quota_var
Definition: plugin_variables.h:258
plugin_local_variables::group_sidno
rpl_sidno group_sidno
Definition: plugin_variables.h:38
plugin_options_variables::recovery_ssl_crl_var
char * recovery_ssl_crl_var
Definition: plugin_variables.h:162
plugin_options_variables::group_seeds_var
char * group_seeds_var
Definition: plugin_variables.h:130
plugin_options_variables::recovery_completion_policy_var
ulong recovery_completion_policy_var
Definition: plugin_variables.h:176
NULL
#define NULL
Definition: types.h:55
plugin_options_variables::group_name_var
char * group_name_var
Definition: plugin_variables.h:127
plugin_options_variables::timeout_on_unreachable_var
ulong timeout_on_unreachable_var
Definition: plugin_variables.h:250
plugin_options_variables::recovery_zstd_compression_level_var
uint recovery_zstd_compression_level_var
Definition: plugin_variables.h:168
plugin_options_variables::bool_type_allowed_values
const char * bool_type_allowed_values[3]
Definition: plugin_variables.h:123
plugin_local_variables::server_shutdown_status
bool server_shutdown_status
Definition: plugin_variables.h:62
plugin_options_variables::ssl_mode_var
ulong ssl_mode_var
Definition: plugin_variables.h:206
plugin_local_variables::plugin_is_waiting_to_set_server_read_mode
bool plugin_is_waiting_to_set_server_read_mode
Definition: plugin_variables.h:61
plugin_options_variables::RECOVERY_SSL_CRL_OPT
static const int RECOVERY_SSL_CRL_OPT
Definition: plugin_variables.h:146
plugin_options_variables::RECOVERY_SSL_CA_OPT
static const int RECOVERY_SSL_CA_OPT
Definition: plugin_variables.h:141
plugin_options_variables::recovery_ssl_capath_var
char * recovery_ssl_capath_var
Definition: plugin_variables.h:158
mysql_mutex_t
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
plugin_options_variables::member_weight_var
uint member_weight_var
Definition: plugin_variables.h:255
plugin_options_variables::single_primary_mode_var
bool single_primary_mode_var
Definition: plugin_variables.h:221
plugin_options_variables::ssl_mode_values
const char * ssl_mode_values[5]
Definition: plugin_variables.h:202
plugin_options_variables::recovery_tls_version_var
char * recovery_tls_version_var
Definition: plugin_variables.h:169
rpl_sidno
int rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:94
plugin_options_variables::RECOVERY_TLS_VERSION_OPT
static const int RECOVERY_TLS_VERSION_OPT
Definition: plugin_variables.h:149
plugin_options_variables::recovery_tls_ciphersuites_var
char * recovery_tls_ciphersuites_var
Definition: plugin_variables.h:170
plugin_options_variables::exit_state_actions_typelib_t
TYPELIB exit_state_actions_typelib_t
Definition: plugin_variables.h:244
Plugin_group_replication_auto_increment
Definition: auto_increment.h:37
plugin_local_variables::plugin_info_ptr
MYSQL_PLUGIN plugin_info_ptr
Definition: plugin_variables.h:36
plugin_local_variables::wait_on_engine_initialization
bool wait_on_engine_initialization
Definition: plugin_variables.h:63
plugin_options_variables::flow_control_mode_var
ulong flow_control_mode_var
Definition: plugin_variables.h:228
plugin_options_variables::allow_local_lower_version_join_var
bool allow_local_lower_version_join_var
Definition: plugin_variables.h:180
plugin_options_variables::RECOVERY_SSL_CRLPATH_OPT
static const int RECOVERY_SSL_CRLPATH_OPT
Definition: plugin_variables.h:147
plugin_options_variables::recovery_ssl_verify_server_cert_var
bool recovery_ssl_verify_server_cert_var
Definition: plugin_variables.h:164
plugin_options_variables::flow_control_applier_threshold_var
long flow_control_applier_threshold_var
Definition: plugin_variables.h:233
plugin_options_variables::RECOVERY_TLS_CIPHERSUITES_OPT
static const int RECOVERY_TLS_CIPHERSUITES_OPT
Definition: plugin_variables.h:150
plugin_options_variables::recovery_retry_count_var
ulong recovery_retry_count_var
Definition: plugin_variables.h:154
plugin_options_variables::flow_control_max_quota_var
long flow_control_max_quota_var
Definition: plugin_variables.h:259
plugin_options_variables::recovery_ssl_opt_map
std::map< const char *, int > recovery_ssl_opt_map
Definition: plugin_variables.h:152
plugin_local_variables::plugin_modules_termination_mutex
mysql_mutex_t plugin_modules_termination_mutex
Definition: plugin_variables.h:43
plugin_options_variables::ssl_mode_values_typelib_t
TYPELIB ssl_mode_values_typelib_t
Definition: plugin_variables.h:204
plugin_local_variables::plugin_online_mutex
mysql_mutex_t plugin_online_mutex
Definition: plugin_variables.h:42
plugin_options_variables::recovery_ssl_cert_var
char * recovery_ssl_cert_var
Definition: plugin_variables.h:159
plugin_local_variables::plugin_running_mutex
mysql_mutex_t plugin_running_mutex
Definition: plugin_variables.h:41
plugin_options_variables::recovery_reconnect_interval_var
ulong recovery_reconnect_interval_var
Definition: plugin_variables.h:155
plugin_options_variables::bootstrap_group_var
bool bootstrap_group_var
Definition: plugin_variables.h:132
plugin_options_variables::force_members_var
char * force_members_var
Definition: plugin_variables.h:131
plugin_options_variables
Definition: plugin_variables.h:119
plugin_options_variables::flow_control_member_quota_percent_var
int flow_control_member_quota_percent_var
Definition: plugin_variables.h:260
HASH_ALGORITHM_OFF
@ HASH_ALGORITHM_OFF
Definition: system_variables.h:84
plugin_options_variables::flow_control_period_var
int flow_control_period_var
Definition: plugin_variables.h:261
plugin_options_variables::recovery_ssl_cipher_var
char * recovery_ssl_cipher_var
Definition: plugin_variables.h:160
plugin_options_variables::flow_control_mode_typelib_t
TYPELIB flow_control_mode_typelib_t
Definition: plugin_variables.h:226
plugin_options_variables::ssl_fips_mode_values
const char * ssl_fips_mode_values[4]
Definition: plugin_variables.h:120
plugin_options_variables::recovery_public_key_path_var
char * recovery_public_key_path_var
Definition: plugin_variables.h:165
plugin_options_variables::flow_control_hold_percent_var
int flow_control_hold_percent_var
Definition: plugin_variables.h:262
plugin_options_variables::ip_whitelist_var
char * ip_whitelist_var
Definition: plugin_variables.h:209
plugin_local_variables::error_state_due_to_error_during_autorejoin
std::atomic< bool > error_state_due_to_error_during_autorejoin
Definition: plugin_variables.h:50
plugin_options_variables::recovery_ssl_ca_var
char * recovery_ssl_ca_var
Definition: plugin_variables.h:157
plugin_options_variables::recovery_compression_algorithm_var
char * recovery_compression_algorithm_var
Definition: plugin_variables.h:167
plugin_options_variables::recovery_ssl_crlpath_var
char * recovery_ssl_crlpath_var
Definition: plugin_variables.h:163
uint
unsigned int uint
Definition: uca-dump.cc:29
plugin_local_variables::known_server_reset
bool known_server_reset
Definition: plugin_variables.h:55
plugin_options_variables::clone_threshold_var
ulonglong clone_threshold_var
Definition: plugin_variables.h:265
plugin_options_variables::RECOVERY_SSL_CIPHER_OPT
static const int RECOVERY_SSL_CIPHER_OPT
Definition: plugin_variables.h:144
plugin_options_variables::communication_max_message_size_var
ulong communication_max_message_size_var
Definition: plugin_variables.h:214
plugin_options_variables::auto_increment_increment_var
ulong auto_increment_increment_var
Definition: plugin_variables.h:190
TYPELIB
Definition: typelib.h:34
plugin_options_variables::recovery_ssl_key_var
char * recovery_ssl_key_var
Definition: plugin_variables.h:161
plugin_local_variables
Definition: plugin_variables.h:35
plugin_local_variables::plugin_is_stopping
std::atomic< bool > plugin_is_stopping
Definition: plugin_variables.h:47
plugin_local_variables::gr_lower_case_table_names
uint gr_lower_case_table_names
Definition: plugin_variables.h:53
plugin_local_variables::online_wait_mutex
Plugin_waitlock * online_wait_mutex
Definition: plugin_variables.h:45
plugin_options_variables::recovery_policies
const char * recovery_policies[3]
Definition: plugin_variables.h:172
plugin_options_variables::compression_threshold_var
ulong compression_threshold_var
Definition: plugin_variables.h:195
plugin_options_variables::RECOVERY_SSL_PUBLIC_KEY_PATH_OPT
static const int RECOVERY_SSL_PUBLIC_KEY_PATH_OPT
Definition: plugin_variables.h:148
plugin_options_variables::flow_control_min_quota_var
long flow_control_min_quota_var
Definition: plugin_variables.h:257
plugin_options_variables::start_group_replication_at_boot_var
bool start_group_replication_at_boot_var
Definition: plugin_variables.h:128
plugin_local_variables::write_set_extraction_algorithm
int write_set_extraction_algorithm
Definition: plugin_variables.h:64
plugin_local_variables::plugin_is_being_uninstalled
bool plugin_is_being_uninstalled
Definition: plugin_variables.h:59
plugin_options_variables::RECOVERY_SSL_KEY_OPT
static const int RECOVERY_SSL_KEY_OPT
Definition: plugin_variables.h:145
plugin_local_variables::auto_increment_handler
Plugin_group_replication_auto_increment * auto_increment_handler
Definition: plugin_variables.h:71
plugin_options_variables::recovery_use_ssl_var
bool recovery_use_ssl_var
Definition: plugin_variables.h:156
Checkable_rwlock
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:430
plugin_local_variables::plugin_is_setting_read_mode
bool plugin_is_setting_read_mode
Definition: plugin_variables.h:60
plugin_local_variables::plugin_version
unsigned int plugin_version
Definition: plugin_variables.h:37
plugin_options_variables::flow_control_certifier_threshold_var
long flow_control_certifier_threshold_var
Definition: plugin_variables.h:232
plugin_local_variables::gr_default_table_encryption
bool gr_default_table_encryption
Definition: plugin_variables.h:54
plugin_local_variables::init
void init()
Definition: plugin_variables.h:77
plugin_options_variables::flow_control_mode_values
const char * flow_control_mode_values[3]
Definition: plugin_variables.h:224
plugin_local_variables::MAX_AUTOREJOIN_TRIES
const uint MAX_AUTOREJOIN_TRIES
Definition: plugin_variables.h:68
plugin_options_variables::recovery_get_public_key_var
bool recovery_get_public_key_var
Definition: plugin_variables.h:166
plugin_local_variables::plugin_is_auto_starting_on_boot
bool plugin_is_auto_starting_on_boot
Definition: plugin_variables.h:57
plugin_options_variables::exit_state_action_var
ulong exit_state_action_var
Definition: plugin_variables.h:246
plugin_local_variables::SERVICE_TYPE
SERVICE_TYPE(registry) *reg_srv
MYSQL_PLUGIN
void * MYSQL_PLUGIN
Definition: plugin.h:73
reg_srv
static const mysql_service_registry_t * reg_srv
Initialize parameters required for error logging.
Definition: test_plugin.cc:61
plugin_options_variables::RECOVERY_SSL_CAPATH_OPT
static const int RECOVERY_SSL_CAPATH_OPT
Definition: plugin_variables.h:142
ulong
unsigned long ulong
Definition: my_inttypes.h:48
plugin_local_variables::group_member_mgr_configured
bool group_member_mgr_configured
Definition: plugin_variables.h:56
plugin_local_variables::group_replication_running
std::atomic< bool > group_replication_running
Definition: plugin_variables.h:48
ulonglong
unsigned long long int ulonglong
Definition: my_inttypes.h:55
mysql_cond_t
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
plugin_options_variables::message_cache_size_var
ulong message_cache_size_var
Definition: plugin_variables.h:219
plugin_options_variables::plugin_bool_typelib_t
TYPELIB plugin_bool_typelib_t
Definition: plugin_variables.h:124
Plugin_waitlock
Definition: plugin_utils.h:787
plugin_local_variables::abort_wait_on_start_process
bool abort_wait_on_start_process
Definition: plugin_variables.h:65
plugin_options_variables::local_address_var
char * local_address_var
Definition: plugin_variables.h:129
plugin_local_variables::force_members_running_mutex
mysql_mutex_t force_members_running_mutex
Definition: plugin_variables.h:40
plugin_options_variables::enforce_update_everywhere_checks_var
bool enforce_update_everywhere_checks_var
Definition: plugin_variables.h:222
plugin_options_variables::transaction_size_limit_var
ulong transaction_size_limit_var
Definition: plugin_variables.h:238
plugin_local_variables::group_replication_cloning
std::atomic< bool > group_replication_cloning
Definition: plugin_variables.h:49
plugin_local_variables::plugin_stop_lock
Checkable_rwlock * plugin_stop_lock
Definition: plugin_variables.h:46
plugin_local_variables::force_members_running
bool force_members_running
Definition: plugin_variables.h:52
plugin_options_variables::exit_state_actions
const char * exit_state_actions[4]
Definition: plugin_variables.h:242
plugin_options_variables::gtid_assignment_block_size_var
ulonglong gtid_assignment_block_size_var
Definition: plugin_variables.h:200
plugin_options_variables::RECOVERY_SSL_CERT_OPT
static const int RECOVERY_SSL_CERT_OPT
Definition: plugin_variables.h:143
plugin_options_variables::flow_control_release_percent_var
int flow_control_release_percent_var
Definition: plugin_variables.h:263
plugin_options_variables::communication_debug_options_var
char * communication_debug_options_var
Definition: plugin_variables.h:240
plugin_options_variables::autorejoin_tries_var
uint autorejoin_tries_var
Definition: plugin_variables.h:248
plugin_local_variables::plugin_online_condition
mysql_cond_t plugin_online_condition
Definition: plugin_variables.h:44
plugin_options_variables::components_stop_timeout_var
ulong components_stop_timeout_var
Definition: plugin_variables.h:178
plugin_local_variables::rejoin_timeout
ulonglong rejoin_timeout
Definition: plugin_variables.h:69
plugin_options_variables::member_expel_timeout_var
ulong member_expel_timeout_var
Definition: plugin_variables.h:138