/usr/include/mysql/server/private
NameSizeModeActions
atomic/-0755rm
data/-0755rm
providers/-0755rm
aligned.h11360644editdlrm
aria_backup.h17870644editdlrm
assume_aligned.h23500644editdlrm
authors.h101940644editdlrm
backup.h17030644editdlrm
bounded_queue.h60930644editdlrm
client_settings.h19350644editdlrm
compat56.h22800644editdlrm
config.h143510644editdlrm
contributors.h49310644editdlrm
create_options.h41930644editdlrm
create_tmp_table.h28080644editdlrm
cset_narrowing.h39680644editdlrm
custom_conf.h10820644editdlrm
datadict.h17000644editdlrm
ddl_log.h128070644editdlrm
debug.h12340644editdlrm
debug_sync.h20460644editdlrm
derived_handler.h23790644editdlrm
derror.h9800644editdlrm
des_key_file.h12360644editdlrm
discover.h15700644editdlrm
dur_prop.h10820644editdlrm
embedded_priv.h17330644editdlrm
events.h47040644editdlrm
event_data_objects.h41870644editdlrm
event_db_repository.h36480644editdlrm
event_parse_data.h28990644editdlrm
event_queue.h34380644editdlrm
event_scheduler.h32900644editdlrm
field.h2224140644editdlrm
field_comp.h11740644editdlrm
filesort.h72830644editdlrm
filesort_utils.h81950644editdlrm
ft_global.h31130644editdlrm
gcalc_slicescan.h173300644editdlrm
gcalc_tools.h119000644editdlrm
grant.h27580644editdlrm
group_by_handler.h35340644editdlrm
gstream.h24370644editdlrm
handler.h1998570644editdlrm
handle_connections_win.h8840644editdlrm
hash.h44520644editdlrm
hash_filo.h55990644editdlrm
ha_handler_stats.h23350644editdlrm
ha_partition.h646960644editdlrm
ha_sequence.h62450644editdlrm
heap.h94870644editdlrm
hostname.h54190644editdlrm
ilist.h72370644editdlrm
init.h8520644editdlrm
innodb_priv.h13190644editdlrm
item.h2854580644editdlrm
item_cmpfunc.h1352180644editdlrm
item_create.h115080644editdlrm
item_func.h1386830644editdlrm
item_geofunc.h396120644editdlrm
item_jsonfunc.h254290644editdlrm
item_row.h52290644editdlrm
item_strfunc.h752650644editdlrm
item_subselect.h590870644editdlrm
item_sum.h726950644editdlrm
item_timefunc.h658960644editdlrm
item_vers.h44130644editdlrm
item_windowfunc.h350890644editdlrm
item_xmlfunc.h46500644editdlrm
json_table.h96670644editdlrm
key.h21320644editdlrm
keycaches.h19950644editdlrm
lex.h298400644editdlrm
lex_charset.h243130644editdlrm
lex_hash.h1431080644editdlrm
lex_ident.h21220644editdlrm
lex_string.h40770644editdlrm
lex_symbol.h13230644editdlrm
lex_token.h426410644editdlrm
lf.h64620644editdlrm
lock.h22200644editdlrm
log.h464620644editdlrm
log_event.h1894670644editdlrm
log_event_data_type.h18900644editdlrm
log_event_old.h198300644editdlrm
log_slow.h24420644editdlrm
maria.h58720644editdlrm
mariadb.h12770644editdlrm
mdl.h388930644editdlrm
mem_root_array.h71060644editdlrm
message.h11950644editdlrm
multi_range_read.h231790644editdlrm
myisam.h175060644editdlrm
myisamchk.h47340644editdlrm
myisammrg.h48970644editdlrm
myisampack.h149290644editdlrm
mysqld.h412250644editdlrm
mysqld_default_groups.h2040644editdlrm
mysqld_suffix.h12010644editdlrm
mysys_err.h30220644editdlrm
my_alarm.h24290644editdlrm
my_apc.h47470644editdlrm
my_atomic.h72810644editdlrm
my_atomic_wrapper.h30510644editdlrm
my_base.h277500644editdlrm
my_bit.h61960644editdlrm
my_bitmap.h55020644editdlrm
my_check_opt.h26180644editdlrm
my_compare.h111940644editdlrm
my_counter.h17210644editdlrm
my_cpu.h48850644editdlrm
my_crypt.h9040644editdlrm
my_decimal.h145040644editdlrm
my_default.h18800644editdlrm
my_handler_errors.h48820644editdlrm
my_json_writer.h187060644editdlrm
my_libwrap.h11830644editdlrm
my_md5.h14860644editdlrm
my_minidump.h8480644editdlrm
my_nosys.h14380644editdlrm
my_rdtsc.h101190644editdlrm
my_rnd.h10140644editdlrm
my_service_manager.h20870644editdlrm
my_stacktrace.h32150644editdlrm
my_stack_alloc.h64930644editdlrm
my_time.h104140644editdlrm
my_tree.h39910644editdlrm
my_uctype.h695280644editdlrm
my_user.h11260644editdlrm
my_virtual_mem.h12550644editdlrm
opt_histogram_json.h46380644editdlrm
opt_range.h659030644editdlrm
opt_subselect.h145450644editdlrm
opt_trace.h95050644editdlrm
opt_trace_context.h32910644editdlrm
parse_file.h44240644editdlrm
partition_element.h54280644editdlrm
partition_info.h198640644editdlrm
password.h16210644editdlrm
pfs_file_provider.h31530644editdlrm
pfs_idle_provider.h13850644editdlrm
pfs_memory_provider.h16260644editdlrm
pfs_metadata_provider.h18980644editdlrm
pfs_socket_provider.h22580644editdlrm
pfs_stage_provider.h15560644editdlrm
pfs_statement_provider.h43470644editdlrm
pfs_table_provider.h26250644editdlrm
pfs_thread_provider.h55600644editdlrm
pfs_transaction_provider.h28460644editdlrm
privilege.h288530644editdlrm
probes_mysql.h9730644editdlrm
probes_mysql_nodtrace.h60870644editdlrm
procedure.h68190644editdlrm
protocol.h125370644editdlrm
proxy_protocol.h5480644editdlrm
queues.h34770644editdlrm
records.h31470644editdlrm
replication.h161300644editdlrm
repl_failsafe.h15850644editdlrm
rijndael.h17110644editdlrm
rowid_filter.h154740644editdlrm
rpl_constants.h33570644editdlrm
rpl_filter.h47740644editdlrm
rpl_gtid.h299850644editdlrm
rpl_injector.h96210644editdlrm
rpl_mi.h166360644editdlrm
rpl_parallel.h182280644editdlrm
rpl_record.h15850644editdlrm
rpl_record_old.h14070644editdlrm
rpl_reporting.h37130644editdlrm
rpl_rli.h360700644editdlrm
rpl_tblmap.h31770644editdlrm
rpl_utility.h98000644editdlrm
scheduler.h31990644editdlrm
scope.h43930644editdlrm
select_handler.h22280644editdlrm
semisync.h22870644editdlrm
semisync_master.h257640644editdlrm
semisync_master_ack_receiver.h87090644editdlrm
semisync_slave.h37360644editdlrm
service_versions.h22850644editdlrm
session_tracker.h142750644editdlrm
set_var.h173310644editdlrm
slave.h123920644editdlrm
socketpair.h8420644editdlrm
source_revision.h670644editdlrm
sp.h225880644editdlrm
span.h39310644editdlrm
spatial.h226980644editdlrm
sp_cache.h20370644editdlrm
sp_head.h649170644editdlrm
sp_pcontext.h254270644editdlrm
sp_rcontext.h144410644editdlrm
sql_acl.h141670644editdlrm
sql_admin.h29150644editdlrm
sql_alloc.h17320644editdlrm
sql_alter.h153950644editdlrm
sql_analyse.h110520644editdlrm
sql_analyze_stmt.h126830644editdlrm
sql_array.h68580644editdlrm
sql_audit.h141620644editdlrm
sql_base.h260500644editdlrm
sql_basic_types.h95230644editdlrm
sql_binlog.h8950644editdlrm
sql_bitmap.h78420644editdlrm
sql_bootstrap.h18120644editdlrm
sql_cache.h216760644editdlrm
sql_callback.h15420644editdlrm
sql_class.h2718360644editdlrm
sql_cmd.h59620644editdlrm
sql_command.h48000644editdlrm
sql_connect.h40870644editdlrm
sql_const.h116300644editdlrm
sql_crypt.h14370644editdlrm
sql_cte.h164940644editdlrm
sql_cursor.h44280644editdlrm
sql_db.h24380644editdlrm
sql_debug.h57270644editdlrm
sql_delete.h13430644editdlrm
sql_derived.h12890644editdlrm
sql_digest.h38190644editdlrm
sql_digest_stream.h15670644editdlrm
sql_do.h9540644editdlrm
sql_error.h398430644editdlrm
sql_explain.h303190644editdlrm
sql_expression_cache.h43590644editdlrm
sql_get_diagnostics.h78830644editdlrm
sql_handler.h29100644editdlrm
sql_help.h9950644editdlrm
sql_hset.h34010644editdlrm
sql_insert.h51730644editdlrm
sql_i_s.h84870644editdlrm
sql_join_cache.h486590644editdlrm
sql_lex.h1749310644editdlrm
sql_lifo_buffer.h96850644editdlrm
sql_limit.h31870644editdlrm
sql_list.h223910644editdlrm
sql_load.h12760644editdlrm
sql_locale.h27010644editdlrm
sql_manager.h9600644editdlrm
sql_mode.h67350644editdlrm
sql_parse.h89700644editdlrm
sql_partition.h126740644editdlrm
sql_partition_admin.h59400644editdlrm
sql_plist.h77110644editdlrm
sql_plugin.h75770644editdlrm
sql_plugin_compat.h22370644editdlrm
sql_prepare.h114090644editdlrm
sql_priv.h185280644editdlrm
sql_profile.h78160644editdlrm
sql_reload.h10360644editdlrm
sql_rename.h9820644editdlrm
sql_repl.h30450644editdlrm
sql_schema.h33030644editdlrm
sql_select.h897430644editdlrm
sql_sequence.h51770644editdlrm
sql_servers.h17770644editdlrm
sql_show.h98190644editdlrm
sql_signal.h33620644editdlrm
sql_sort.h219640644editdlrm
sql_statistics.h165040644editdlrm
sql_string.h390090644editdlrm
sql_table.h98120644editdlrm
sql_test.h26650644editdlrm
sql_time.h85050644editdlrm
sql_trigger.h123320644editdlrm
sql_truncate.h20790644editdlrm
sql_tvc.h24180644editdlrm
sql_type.h2972720644editdlrm
sql_type_fixedbin.h655780644editdlrm
sql_type_fixedbin_storage.h54670644editdlrm
sql_type_geom.h190390644editdlrm
sql_type_int.h100010644editdlrm
sql_type_json.h61550644editdlrm
sql_type_real.h12570644editdlrm
sql_type_string.h16290644editdlrm
sql_udf.h48500644editdlrm
sql_union.h10680644editdlrm
sql_update.h19230644editdlrm
sql_view.h24700644editdlrm
sql_window.h68140644editdlrm
ssl_compat.h33800644editdlrm
strfunc.h25490644editdlrm
structs.h294570644editdlrm
sys_vars_shared.h27290644editdlrm
table.h1190090644editdlrm
table_cache.h42320644editdlrm
threadpool.h48100644editdlrm
threadpool_generic.h39690644editdlrm
threadpool_winsockets.h22900644editdlrm
thread_cache.h59050644editdlrm
thr_alarm.h29320644editdlrm
thr_lock.h73500644editdlrm
thr_malloc.h12020644editdlrm
thr_timer.h15630644editdlrm
transaction.h14660644editdlrm
tzfile.h50140644editdlrm
tztime.h33970644editdlrm
t_ctype.h56390644editdlrm
uniques.h42170644editdlrm
unireg.h77220644editdlrm
vers_string.h25430644editdlrm
violite.h99560644editdlrm
waiting_threads.h45320644editdlrm
welcome_copyright_notice.h12180644editdlrm
winservice.h60190644editdlrm
win_tzname_data.h65060644editdlrm
wqueue.h15650644editdlrm
wsrep.h33080644editdlrm
wsrep_allowlist_service.h10350644editdlrm
wsrep_applier.h27030644editdlrm
wsrep_binlog.h35510644editdlrm
wsrep_client_service.h26020644editdlrm
wsrep_client_state.h15660644editdlrm
wsrep_condition_variable.h14840644editdlrm
wsrep_high_priority_service.h49120644editdlrm
wsrep_mutex.h12390644editdlrm
wsrep_mysqld.h220060644editdlrm
wsrep_mysqld_c.h12270644editdlrm
wsrep_on.h17180644editdlrm
wsrep_priv.h16340644editdlrm
wsrep_schema.h58860644editdlrm
wsrep_server_service.h36310644editdlrm
wsrep_server_state.h25290644editdlrm
wsrep_sst.h39510644editdlrm
wsrep_status.h18160644editdlrm
wsrep_storage_service.h18090644editdlrm
wsrep_thd.h114870644editdlrm
wsrep_trans_observer.h181740644editdlrm
wsrep_types.h11100644editdlrm
wsrep_utils.h102510644editdlrm
wsrep_var.h46120644editdlrm
wsrep_xid.h15090644editdlrm
xa.h18450644editdlrm
Edit: /usr/include/mysql/server/private/rpl_parallel.h (18228B)
#ifndef RPL_PARALLEL_H #define RPL_PARALLEL_H #include "log_event.h" struct rpl_parallel; struct rpl_parallel_entry; struct rpl_parallel_thread_pool; extern struct rpl_parallel_thread_pool pool_bkp_for_pfs; class Relay_log_info; struct inuse_relaylog; /* Structure used to keep track of the parallel replication of a batch of event-groups that group-committed together on the master. It is used to ensure that every event group in one batch has reached the commit stage before the next batch starts executing. Note the lifetime of this structure: - It is allocated when the first event in a new batch of group commits is queued, from the free list rpl_parallel_entry::gco_free_list. - The gco for the batch currently being queued is owned by rpl_parallel_entry::current_gco. The gco for a previous batch that has been fully queued is owned by the gco->prev_gco pointer of the gco for the following batch. - The worker thread waits on gco->COND_group_commit_orderer for rpl_parallel_entry::count_committing_event_groups to reach wait_count before starting; the first waiter links the gco into the next_gco pointer of the gco of the previous batch for signalling. - When an event group reaches the commit stage, it signals the COND_group_commit_orderer if its gco->next_gco pointer is non-NULL and rpl_parallel_entry::count_committing_event_groups has reached gco->next_gco->wait_count. - The gco lives until all its event groups have completed their commit. This is detected by rpl_parallel_entry::last_committed_sub_id being greater than or equal gco->last_sub_id. Once this happens, the gco is freed. Note that since update of last_committed_sub_id can happen out-of-order, the thread that frees a given gco can be for any later event group, not necessarily an event group from the gco being freed. */ struct group_commit_orderer { /* Wakeup condition, used with rpl_parallel_entry::LOCK_parallel_entry. */ mysql_cond_t COND_group_commit_orderer; uint64 wait_count; group_commit_orderer *prev_gco; group_commit_orderer *next_gco; /* The sub_id of last event group in the previous GCO. Only valid if prev_gco != NULL. */ uint64 prior_sub_id; /* The sub_id of the last event group in this GCO. Only valid when next_gco is non-NULL. */ uint64 last_sub_id; /* This flag is set when this GCO has been installed into the next_gco pointer of the previous GCO. */ bool installed; enum force_switch_bits { /* This flag is set for a GCO in which we have event groups with multiple different commit_id values from the master. This happens when we optimistically try to execute in parallel transactions not known to be conflict-free. When this flag is set, in case of DDL we need to start a new GCO regardless of current commit_id, as DDL is not safe to speculatively apply in parallel with prior event groups. */ MULTI_BATCH= 1, /* This flag is set for a GCO that contains DDL. If set, it forces a switch to a new GCO upon seeing a new commit_id, as DDL is not safe to speculatively replicate in parallel with subsequent transactions. */ FORCE_SWITCH= 2 }; uint8 flags; #ifndef DBUG_OFF /* Flag set when the GCO has been freed and entered the free list, to catch (in debug) errors in the complex lifetime of this object. */ bool gc_done; #endif }; struct rpl_parallel_thread { bool delay_start; bool running; bool stop; bool pause_for_ftwrl; /* 0 = No start alter assigned >0 = Start alter assigned */ uint64 current_start_alter_id; uint32 current_start_alter_domain_id; /* This flag is true when Start Alter just needs to be binlogged only. This scenario will happens when there is congestion , and we can not allocate independent worker to start alter. */ bool reserved_start_alter_thread; mysql_mutex_t LOCK_rpl_thread; mysql_cond_t COND_rpl_thread; mysql_cond_t COND_rpl_thread_queue; mysql_cond_t COND_rpl_thread_stop; struct rpl_parallel_thread *next; /* For free list. */ struct rpl_parallel_thread_pool *pool; THD *thd; /* Who owns the thread, if any (it's a pointer into the rpl_parallel_entry::rpl_threads array. */ struct rpl_parallel_thread **current_owner; /* The rpl_parallel_entry of the owner. */ rpl_parallel_entry *current_entry; struct queued_event { queued_event *next; /* queued_event can hold either an event to be executed, or just a binlog position to be updated without any associated event. */ enum queued_event_t { QUEUED_EVENT, QUEUED_POS_UPDATE, QUEUED_MASTER_RESTART } typ; union { Log_event *ev; /* QUEUED_EVENT */ rpl_parallel_entry *entry_for_queued; /* QUEUED_POS_UPDATE and QUEUED_MASTER_RESTART */ }; rpl_group_info *rgi; inuse_relaylog *ir; ulonglong future_event_relay_log_pos; char event_relay_log_name[FN_REFLEN]; char future_event_master_log_name[FN_REFLEN]; ulonglong event_relay_log_pos; my_off_t future_event_master_log_pos; size_t event_size; } *event_queue, *last_in_queue; uint64 queued_size; /* These free lists are protected by LOCK_rpl_thread. */ queued_event *qev_free_list; rpl_group_info *rgi_free_list; group_commit_orderer *gco_free_list; /* These free lists are local to the thread, so need not be protected by any lock. They are moved to the global free lists in batches in the function batch_free(), to reduce LOCK_rpl_thread contention. The lists are not NULL-terminated (as we do not need to traverse them). Instead, if they are non-NULL, the loc_XXX_last_ptr_ptr points to the `next' pointer of the last element, which is used to link into the front of the global freelists. */ queued_event *loc_qev_list, **loc_qev_last_ptr_ptr; size_t loc_qev_size; uint64 qev_free_pending; rpl_group_info *loc_rgi_list, **loc_rgi_last_ptr_ptr; group_commit_orderer *loc_gco_list, **loc_gco_last_ptr_ptr; /* These keep track of batch update of inuse_relaylog refcounts. */ inuse_relaylog *accumulated_ir_last; uint64 accumulated_ir_count; char channel_name[MAX_CONNECTION_NAME]; uint channel_name_length; rpl_gtid last_seen_gtid; int last_error_number; char last_error_message[MAX_SLAVE_ERRMSG]; ulonglong last_error_timestamp; ulonglong worker_idle_time; ulong last_trans_retry_count; ulonglong start_time; void start_time_tracker() { start_time= microsecond_interval_timer(); } ulonglong compute_time_lapsed() { return (ulonglong)((microsecond_interval_timer() - start_time) / 1000000.0); } void add_to_worker_idle_time_and_reset() { worker_idle_time+= compute_time_lapsed(); start_time=0; } ulonglong get_worker_idle_time() { if (start_time) return (worker_idle_time + compute_time_lapsed()); else return worker_idle_time; } void enqueue(queued_event *qev) { if (last_in_queue) last_in_queue->next= qev; else event_queue= qev; last_in_queue= qev; queued_size+= qev->event_size; } void dequeue1(queued_event *list) { DBUG_ASSERT(list == event_queue); event_queue= last_in_queue= NULL; } void dequeue2(size_t dequeue_size) { queued_size-= dequeue_size; } queued_event *get_qev_common(Log_event *ev, ulonglong event_size); queued_event *get_qev(Log_event *ev, ulonglong event_size, Relay_log_info *rli); queued_event *retry_get_qev(Log_event *ev, queued_event *orig_qev, const char *relay_log_name, ulonglong event_pos, ulonglong event_size); /* Put a qev on the local free list, to be later released to the global free list by batch_free(). */ void loc_free_qev(queued_event *qev); /* Release an rgi immediately to the global free list. Requires holding the LOCK_rpl_thread mutex. */ void free_qev(queued_event *qev); rpl_group_info *get_rgi(Relay_log_info *rli, Gtid_log_event *gtid_ev, rpl_parallel_entry *e, ulonglong event_size); /* Put an gco on the local free list, to be later released to the global free list by batch_free(). */ void loc_free_rgi(rpl_group_info *rgi); /* Release an rgi immediately to the global free list. Requires holding the LOCK_rpl_thread mutex. */ void free_rgi(rpl_group_info *rgi); group_commit_orderer *get_gco(uint64 wait_count, group_commit_orderer *prev, uint64 first_sub_id); /* Put a gco on the local free list, to be later released to the global free list by batch_free(). */ void loc_free_gco(group_commit_orderer *gco); /* Move all local free lists to the global ones. Requires holding LOCK_rpl_thread. */ void batch_free(); /* Update inuse_relaylog refcounts with what we have accumulated so far. */ void inuse_relaylog_refcount_update(); rpl_parallel_thread(); }; struct pool_bkp_for_pfs{ uint32 count; bool inited, is_valid; struct rpl_parallel_thread **rpl_thread_arr; void init(uint32 thd_count) { DBUG_ASSERT(thd_count); rpl_thread_arr= (rpl_parallel_thread **) my_malloc(PSI_INSTRUMENT_ME, thd_count * sizeof(rpl_parallel_thread*), MYF(MY_WME | MY_ZEROFILL)); for (uint i=0; i *thread_sched_fifo; uint32 rpl_thread_max; /* Keep track of all XA XIDs that may still be active in a worker thread. The elements are of type xid_active_generation. */ DYNAMIC_ARRAY maybe_active_xid; /* Keeping track of the current scheduling generation. A new generation means that every worker thread in the rpl_threads array have been scheduled at least one event group. When we have scheduled to slot current_generation_idx= 0, 1, ..., N-1 in this order, we know that (at least) one generation has passed. */ uint64 current_generation; uint32 current_generation_idx; /* The sub_id of the last transaction to commit within this domain_id. Must be accessed under LOCK_parallel_entry protection. Event groups commit in order, so the rpl_group_info for an event group will be alive (at least) as long as rpl_group_info::gtid_sub_id > last_committed_sub_id. This can be used to safely refer back to previous event groups if they are still executing, and ignore them if they completed, without requiring explicit synchronisation between the threads. */ uint64 last_committed_sub_id; /* The sub_id of the last event group in this replication domain that was queued for execution by a worker thread. */ uint64 current_sub_id; /* The largest sub_id that has started its transaction. Protected by LOCK_parallel_entry. (Transactions can start out-of-order, so this value signifies that no transactions with larger sub_id have started, but not necessarily that all transactions with smaller sub_id have started). */ uint64 largest_started_sub_id; rpl_group_info *current_group_info; /* If we get an error in some event group, we set the sub_id of that event group here. Then later event groups (with higher sub_id) can know not to try to start (event groups that already started will be rolled back when wait_for_prior_commit() returns error). The value is ULONGLONG_MAX when no error occurred. */ uint64 stop_on_error_sub_id; /* During FLUSH TABLES WITH READ LOCK, transactions with sub_id larger than this value must not start, but wait until the global read lock is released. The value is set to ULONGLONG_MAX when no FTWRL is pending. */ uint64 pause_sub_id; /* Total count of event groups queued so far. */ uint64 count_queued_event_groups; /* Count of event groups that have started (but not necessarily completed) the commit phase. We use this to know when every event group in a previous batch of master group commits have started committing on the slave, so that it is safe to start executing the events in the following batch. */ uint64 count_committing_event_groups; /* The group_commit_orderer object for the events currently being queued. */ group_commit_orderer *current_gco; /* Relay log info of replication source for this entry. */ Relay_log_info *rli; void check_scheduling_generation(sched_bucket *cur); sched_bucket *check_xa_xid_dependency(xid_t *xid); rpl_parallel_thread * choose_thread(rpl_group_info *rgi, bool *did_enter_cond, PSI_stage_info *old_stage, Gtid_log_event *gtid_ev); rpl_parallel_thread * choose_thread_internal(sched_bucket *cur_thr, bool *did_enter_cond, rpl_group_info *rgi, PSI_stage_info *old_stage); int queue_master_restart(rpl_group_info *rgi, Format_description_log_event *fdev); /* the initial size of maybe_ array corresponds to the case of each worker receives perhaps unlikely XA-PREPARE and XA-COMMIT within the same generation. */ inline uint active_xid_init_alloc() { return 3 * 2 * rpl_thread_max; } }; struct rpl_parallel { HASH domain_hash; rpl_parallel_entry *current; bool sql_thread_stopping; rpl_parallel(); ~rpl_parallel(); void reset(); rpl_parallel_entry *find(uint32 domain_id, Relay_log_info *rli); void wait_for_done(THD *thd, Relay_log_info *rli); void stop_during_until(); int wait_for_workers_idle(THD *thd); int do_event(rpl_group_info *serial_rgi, Log_event *ev, ulonglong event_size); }; extern struct rpl_parallel_thread_pool global_rpl_thread_pool; extern void wait_for_pending_deadlock_kill(THD *thd, rpl_group_info *rgi); extern int rpl_parallel_resize_pool_if_no_slaves(void); extern int rpl_parallel_activate_pool(rpl_parallel_thread_pool *pool); extern int rpl_parallel_inactivate_pool(rpl_parallel_thread_pool *pool); extern bool process_gtid_for_restart_pos(Relay_log_info *rli, rpl_gtid *gtid); extern int rpl_pause_for_ftwrl(THD *thd); extern void rpl_unpause_after_ftwrl(THD *thd); #endif /* RPL_PARALLEL_H */