MySQL  8.0.20
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() {
78  plugin_info_ptr = nullptr;
79  plugin_version = 0;
80  group_sidno = 0;
81 
82  online_wait_mutex = nullptr;
83  plugin_stop_lock = nullptr;
84  plugin_is_stopping = false;
85  group_replication_running = false;
86  group_replication_cloning = false;
87  error_state_due_to_error_during_autorejoin = false;
88 
89  force_members_running = false;
90  gr_lower_case_table_names = 0;
91  gr_default_table_encryption = false;
92  known_server_reset = false;
93  group_member_mgr_configured = false;
94  plugin_is_auto_starting_on_boot = false;
95  plugin_is_auto_starting_on_install = false;
96  plugin_is_being_uninstalled = false;
97  plugin_is_setting_read_mode = false;
98  plugin_is_waiting_to_set_server_read_mode = false;
99  server_shutdown_status = false;
100  wait_on_engine_initialization = false;
101  write_set_extraction_algorithm = HASH_ALGORITHM_OFF;
102  abort_wait_on_start_process = false;
103  // the default is 5 minutes (300 secs).
104  rejoin_timeout = 300ULL;
105 
106  auto_increment_handler = nullptr;
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 *)nullptr};
122 
123  const char *bool_type_allowed_values[3] = {"OFF", "ON",
124  (const char *)nullptr};
125  TYPELIB plugin_bool_typelib_t = {2, "bool_type_typelib_t",
126  bool_type_allowed_values, nullptr};
127 
135 
136 #define DEFAULT_MEMBER_EXPEL_TIMEOUT 0
137 #define MAX_MEMBER_EXPEL_TIMEOUT 3600
138 #define MIN_MEMBER_EXPEL_TIMEOUT 0
140 
141  // Option map entries that map the different SSL options to integer
142  static const int RECOVERY_SSL_CA_OPT = 1;
143  static const int RECOVERY_SSL_CAPATH_OPT = 2;
144  static const int RECOVERY_SSL_CERT_OPT = 3;
145  static const int RECOVERY_SSL_CIPHER_OPT = 4;
146  static const int RECOVERY_SSL_KEY_OPT = 5;
147  static const int RECOVERY_SSL_CRL_OPT = 6;
148  static const int RECOVERY_SSL_CRLPATH_OPT = 7;
149  static const int RECOVERY_SSL_PUBLIC_KEY_PATH_OPT = 8;
150  static const int RECOVERY_TLS_VERSION_OPT = 9;
151  static const int RECOVERY_TLS_CIPHERSUITES_OPT = 10;
152  // The option map <SSL var_name, SSL var code>
153  std::map<const char *, int> recovery_ssl_opt_map;
154 
172 
173  const char *recovery_policies[3] = {"TRANSACTIONS_CERTIFIED",
174  "TRANSACTIONS_APPLIED", (char *)nullptr};
175  TYPELIB recovery_policies_typelib_t = {2, "recovery_policies_typelib_t",
176  recovery_policies, nullptr};
178 
180 
182 
183  /*
184  The default value for auto_increment_increment is choosen taking into
185  account the maximum usable values for each possible auto_increment_increment
186  and what is a normal group expected size.
187  */
188 #define DEFAULT_AUTO_INCREMENT_INCREMENT 7
189 #define MIN_AUTO_INCREMENT_INCREMENT 1
190 #define MAX_AUTO_INCREMENT_INCREMENT 65535
192 
193 #define DEFAULT_COMPRESSION_THRESHOLD 1000000
194 #define MAX_COMPRESSION_THRESHOLD UINT_MAX32
195 #define MIN_COMPRESSION_THRESHOLD 0
197 
198 #define DEFAULT_GTID_ASSIGNMENT_BLOCK_SIZE 1000000
199 #define MIN_GTID_ASSIGNMENT_BLOCK_SIZE 1
200 #define MAX_GTID_ASSIGNMENT_BLOCK_SIZE MAX_GNO
202 
203  const char *ssl_mode_values[5] = {"DISABLED", "REQUIRED", "VERIFY_CA",
204  "VERIFY_IDENTITY", (char *)nullptr};
205  TYPELIB ssl_mode_values_typelib_t = {4, "ssl_mode_values_typelib_t",
206  ssl_mode_values, nullptr};
208 
209 #define IP_WHITELIST_STR_BUFFER_LENGTH 1024
211 
212 #define DEFAULT_COMMUNICATION_MAX_MESSAGE_SIZE 10485760
213 #define MAX_COMMUNICATION_MAX_MESSAGE_SIZE get_max_slave_max_allowed_packet()
214 #define MIN_COMMUNICATION_MAX_MESSAGE_SIZE 0
216 
217 #define DEFAULT_MESSAGE_CACHE_SIZE 1073741824
218 #define MIN_MESSAGE_CACHE_SIZE DEFAULT_MESSAGE_CACHE_SIZE
219 #define MAX_MESSAGE_CACHE_SIZE ULONG_MAX
221 
224 
225  const char *flow_control_mode_values[3] = {"DISABLED", "QUOTA",
226  (const char *)nullptr};
227  TYPELIB flow_control_mode_typelib_t = {2, "flow_control_mode_typelib_t",
228  flow_control_mode_values, nullptr};
230 #define DEFAULT_FLOW_CONTROL_THRESHOLD 25000
231 #define MAX_FLOW_CONTROL_THRESHOLD INT_MAX32
232 #define MIN_FLOW_CONTROL_THRESHOLD 0
235 
236 #define DEFAULT_TRANSACTION_SIZE_LIMIT 150000000
237 #define MAX_TRANSACTION_SIZE_LIMIT 2147483647
238 #define MIN_TRANSACTION_SIZE_LIMIT 0
240 
242 
243  const char *exit_state_actions[4] = {"READ_ONLY", "ABORT_SERVER",
244  "OFFLINE_MODE", (char *)nullptr};
245  TYPELIB exit_state_actions_typelib_t = {3, "exit_state_actions_typelib_t",
246  exit_state_actions, nullptr};
248 
250 
252 
253 #define DEFAULT_MEMBER_WEIGHT 50
254 #define MAX_MEMBER_WEIGHT 100
255 #define MIN_MEMBER_WEIGHT 0
257 
265 
267 };
268 
269 #endif /* PLUGIN_VARIABLES_INCLUDE */
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Definition: system_variables.h:84
int rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:95
ulong timeout_on_unreachable_var
Definition: plugin_variables.h:251
long flow_control_min_recovery_quota_var
Definition: plugin_variables.h:259
int flow_control_release_percent_var
Definition: plugin_variables.h:264
char * recovery_ssl_crl_var
Definition: plugin_variables.h:163
char * recovery_public_key_path_var
Definition: plugin_variables.h:166
int flow_control_hold_percent_var
Definition: plugin_variables.h:263
long flow_control_min_quota_var
Definition: plugin_variables.h:258
char * recovery_ssl_cert_var
Definition: plugin_variables.h:160
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
SERVICE_TYPE(registry) *reg_srv
long flow_control_certifier_threshold_var
Definition: plugin_variables.h:233
Definition: plugin_utils.h:783
ulonglong clone_threshold_var
Definition: plugin_variables.h:266
bool group_member_mgr_configured
Definition: plugin_variables.h:56
bool wait_on_engine_initialization
Definition: plugin_variables.h:63
ulong exit_state_action_var
Definition: plugin_variables.h:247
bool allow_local_lower_version_join_var
Definition: plugin_variables.h:181
char * group_name_var
Definition: plugin_variables.h:128
uint recovery_zstd_compression_level_var
Definition: plugin_variables.h:169
ulong recovery_retry_count_var
Definition: plugin_variables.h:155
ulonglong rejoin_timeout
Definition: plugin_variables.h:69
char * recovery_tls_ciphersuites_var
Definition: plugin_variables.h:171
std::atomic< bool > group_replication_cloning
Definition: plugin_variables.h:49
char * communication_debug_options_var
Definition: plugin_variables.h:241
int flow_control_member_quota_percent_var
Definition: plugin_variables.h:261
std::atomic< bool > error_state_due_to_error_during_autorejoin
Definition: plugin_variables.h:50
ulong transaction_size_limit_var
Definition: plugin_variables.h:239
mysql_mutex_t plugin_online_mutex
Definition: plugin_variables.h:42
char * recovery_ssl_ca_var
Definition: plugin_variables.h:158
char * recovery_ssl_capath_var
Definition: plugin_variables.h:159
char * group_seeds_var
Definition: plugin_variables.h:131
bool recovery_get_public_key_var
Definition: plugin_variables.h:167
ulong recovery_reconnect_interval_var
Definition: plugin_variables.h:156
std::map< const char *, int > recovery_ssl_opt_map
Definition: plugin_variables.h:153
Plugin_waitlock * online_wait_mutex
Definition: plugin_variables.h:45
bool plugin_is_setting_read_mode
Definition: plugin_variables.h:60
ulonglong gtid_assignment_block_size_var
Definition: plugin_variables.h:201
ulong ssl_mode_var
Definition: plugin_variables.h:207
char * force_members_var
Definition: plugin_variables.h:132
uint gr_lower_case_table_names
Definition: plugin_variables.h:53
bool plugin_is_being_uninstalled
Definition: plugin_variables.h:59
void * MYSQL_PLUGIN
Definition: plugin.h:73
ulong components_stop_timeout_var
Definition: plugin_variables.h:179
Definition: plugin_variables.h:119
bool plugin_is_waiting_to_set_server_read_mode
Definition: plugin_variables.h:61
char * recovery_ssl_cipher_var
Definition: plugin_variables.h:161
bool single_primary_mode_var
Definition: plugin_variables.h:222
unsigned int plugin_version
Definition: plugin_variables.h:37
bool gr_default_table_encryption
Definition: plugin_variables.h:54
mysql_mutex_t plugin_modules_termination_mutex
Definition: plugin_variables.h:43
unsigned int uint
Definition: uca-dump.cc:29
MYSQL_PLUGIN plugin_info_ptr
Definition: plugin_variables.h:36
bool bootstrap_group_var
Definition: plugin_variables.h:133
std::atomic< bool > plugin_is_stopping
Definition: plugin_variables.h:47
mysql_mutex_t plugin_running_mutex
Definition: plugin_variables.h:41
Plugin_group_replication_auto_increment * auto_increment_handler
Definition: plugin_variables.h:71
char * recovery_compression_algorithm_var
Definition: plugin_variables.h:168
ulong compression_threshold_var
Definition: plugin_variables.h:196
Definition: auto_increment.h:37
char * ip_whitelist_var
Definition: plugin_variables.h:210
bool enforce_update_everywhere_checks_var
Definition: plugin_variables.h:223
bool plugin_is_auto_starting_on_boot
Definition: plugin_variables.h:57
char * recovery_ssl_crlpath_var
Definition: plugin_variables.h:164
Definition: typelib.h:34
bool abort_wait_on_start_process
Definition: plugin_variables.h:65
std::atomic< bool > group_replication_running
Definition: plugin_variables.h:48
uint member_weight_var
Definition: plugin_variables.h:256
ulong recovery_completion_policy_var
Definition: plugin_variables.h:177
ulong communication_max_message_size_var
Definition: plugin_variables.h:215
rpl_sidno group_sidno
Definition: plugin_variables.h:38
mysql_cond_t plugin_online_condition
Definition: plugin_variables.h:44
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
long flow_control_applier_threshold_var
Definition: plugin_variables.h:234
ulong flow_control_mode_var
Definition: plugin_variables.h:229
Checkable_rwlock * plugin_stop_lock
Definition: plugin_variables.h:46
bool start_group_replication_at_boot_var
Definition: plugin_variables.h:129
char * recovery_tls_version_var
Definition: plugin_variables.h:170
bool plugin_is_auto_starting_on_install
Definition: plugin_variables.h:58
void init()
Definition: plugin_variables.h:77
uint autorejoin_tries_var
Definition: plugin_variables.h:249
const uint MAX_AUTOREJOIN_TRIES
Definition: plugin_variables.h:68
static const mysql_service_registry_t * reg_srv
Initialize parameters required for error logging.
Definition: test_plugin.cc:61
bool force_members_running
Definition: plugin_variables.h:52
char * local_address_var
Definition: plugin_variables.h:130
bool recovery_ssl_verify_server_cert_var
Definition: plugin_variables.h:165
int flow_control_period_var
Definition: plugin_variables.h:262
bool recovery_use_ssl_var
Definition: plugin_variables.h:157
bool known_server_reset
Definition: plugin_variables.h:55
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:431
char * recovery_ssl_key_var
Definition: plugin_variables.h:162
bool server_shutdown_status
Definition: plugin_variables.h:62
int write_set_extraction_algorithm
Definition: plugin_variables.h:64
Definition: plugin_variables.h:35
ulong message_cache_size_var
Definition: plugin_variables.h:220
mysql_mutex_t force_members_running_mutex
Definition: plugin_variables.h:40
ulong poll_spin_loops_var
Definition: plugin_variables.h:134
ulong auto_increment_increment_var
Definition: plugin_variables.h:191
long flow_control_max_quota_var
Definition: plugin_variables.h:260
ulong member_expel_timeout_var
Definition: plugin_variables.h:139