Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PXC-4173: PXC node stalls with parallel replication workers executing DDLs via async node #1927

Open
wants to merge 7 commits into
base: 8.0
Choose a base branch
from
Prev Previous commit
Next Next commit
- Add a new server variable wsrep_use_async_monitor for backward
  compatibility
  • Loading branch information
venkatesh-prasad-v committed Nov 25, 2024
commit 562db793952ef410a747c08714f9329b87e73337
3 changes: 2 additions & 1 deletion sql/rpl_replica.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7278,7 +7278,8 @@ wsrep_restart_point :

#ifdef WITH_WSREP
// Restore the last executed seqno
if (WSREP_ON && opt_replica_preserve_commit_order
if (WSREP_ON && wsrep_use_async_monitor
&& opt_replica_preserve_commit_order
&& !rli->is_parallel_exec()
&& rli->opt_replica_parallel_workers > 1) {
wsrep_async_monitor = new Wsrep_async_monitor(rli->opt_replica_parallel_workers);
Expand Down
9 changes: 9 additions & 0 deletions sql/sys_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8836,6 +8836,15 @@ static Sys_var_enum Sys_wsrep_disk_pages_encrypt(
READ_ONLY GLOBAL_VAR(wsrep_disk_pages_encrypt), CMD_LINE(OPT_ARG), wsrep_encrypt_modes,
DEFAULT(WSREP_ENCRYPT_MODE_NONE), NO_MUTEX_GUARD, NOT_IN_BINLOG);

static Sys_var_bool Sys_wsrep_async_monitor(
"wsrep_use_async_monitor",
"Use Async Monitors to avoid deadlock of replicated transactions in a multi-threaded replica. "
"Deadlock is possible when the PXC replica tries commit the replicated transactions in galera "
"in a different order than its order in the relay log. Use 'wsrep_use_async_monitor' to avoid "
"such deadlocks."
"This variable is only allowed to be changed through command line. ",
READ_ONLY GLOBAL_VAR(wsrep_use_async_monitor), CMD_LINE(OPT_ARG),
DEFAULT(true), NO_MUTEX_GUARD, NOT_IN_BINLOG);
#endif /* WITH_WSREP */

static bool check_set_require_row_format(sys_var *, THD *thd, set_var *var) {
Expand Down
3 changes: 3 additions & 0 deletions sql/wsrep_mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ bool pxc_encrypt_cluster_traffic = 0;
ulong wsrep_gcache_encrypt = WSREP_ENCRYPT_MODE_NONE;
ulong wsrep_disk_pages_encrypt = WSREP_ENCRYPT_MODE_NONE;

/* Enables Async Monitors to avoid TOI deadlocks */
bool wsrep_use_async_monitor = true;

/* force flush of error message if error is detected at early stage
during SST or other initialization. */
bool pxc_force_flush_error_message = false;
Expand Down
1 change: 1 addition & 0 deletions sql/wsrep_mysqld.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ enum enump_wsrep_encrypt_modes {
};
extern ulong wsrep_gcache_encrypt;
extern ulong wsrep_disk_pages_encrypt;
extern bool wsrep_use_async_monitor;

extern bool pxc_force_flush_error_message;

Expand Down
Loading