Commit a98a034c authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-7102: Incorrect PSI_stage_info message in SHOW PROCESSLIST during parallel replication

In parallel replication, threads can do two different waits for a prior
transaction. One is for the prior transaction to start commit, the other is
for it to complete commit.

It turns out that the same PSI_stage_info message was errorneously used in
both cases (probably a merge error), causing SHOW PROCESSLIST to be
misleading.

Fix by using correct, distinct message in each case.
parent ecc33da2
...@@ -9484,7 +9484,8 @@ PSI_stage_info stage_binlog_waiting_background_tasks= { 0, "Waiting for backgrou ...@@ -9484,7 +9484,8 @@ PSI_stage_info stage_binlog_waiting_background_tasks= { 0, "Waiting for backgrou
PSI_stage_info stage_binlog_processing_checkpoint_notify= { 0, "Processing binlog checkpoint notification", 0}; PSI_stage_info stage_binlog_processing_checkpoint_notify= { 0, "Processing binlog checkpoint notification", 0};
PSI_stage_info stage_binlog_stopping_background_thread= { 0, "Stopping binlog background thread", 0}; PSI_stage_info stage_binlog_stopping_background_thread= { 0, "Stopping binlog background thread", 0};
PSI_stage_info stage_waiting_for_work_from_sql_thread= { 0, "Waiting for work from SQL thread", 0}; PSI_stage_info stage_waiting_for_work_from_sql_thread= { 0, "Waiting for work from SQL thread", 0};
PSI_stage_info stage_waiting_for_prior_transaction_to_commit= { 0, "Waiting for prior transaction to start commit before starting next transaction", 0}; PSI_stage_info stage_waiting_for_prior_transaction_to_commit= { 0, "Waiting for prior transaction to commit", 0};
PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit= { 0, "Waiting for prior transaction to start commit before starting next transaction", 0};
PSI_stage_info stage_waiting_for_room_in_worker_thread= { 0, "Waiting for room in worker thread event queue", 0}; PSI_stage_info stage_waiting_for_room_in_worker_thread= { 0, "Waiting for room in worker thread event queue", 0};
PSI_stage_info stage_master_gtid_wait_primary= { 0, "Waiting in MASTER_GTID_WAIT() (primary waiter)", 0}; PSI_stage_info stage_master_gtid_wait_primary= { 0, "Waiting in MASTER_GTID_WAIT() (primary waiter)", 0};
PSI_stage_info stage_master_gtid_wait= { 0, "Waiting in MASTER_GTID_WAIT()", 0}; PSI_stage_info stage_master_gtid_wait= { 0, "Waiting in MASTER_GTID_WAIT()", 0};
...@@ -9599,6 +9600,7 @@ PSI_stage_info *all_server_stages[]= ...@@ -9599,6 +9600,7 @@ PSI_stage_info *all_server_stages[]=
& stage_waiting_for_master_to_send_event, & stage_waiting_for_master_to_send_event,
& stage_waiting_for_master_update, & stage_waiting_for_master_update,
& stage_waiting_for_prior_transaction_to_commit, & stage_waiting_for_prior_transaction_to_commit,
& stage_waiting_for_prior_transaction_to_start_commit,
& stage_waiting_for_query_cache_lock, & stage_waiting_for_query_cache_lock,
& stage_waiting_for_relay_log_space, & stage_waiting_for_relay_log_space,
& stage_waiting_for_room_in_worker_thread, & stage_waiting_for_room_in_worker_thread,
......
...@@ -448,6 +448,7 @@ extern PSI_stage_info stage_binlog_processing_checkpoint_notify; ...@@ -448,6 +448,7 @@ extern PSI_stage_info stage_binlog_processing_checkpoint_notify;
extern PSI_stage_info stage_binlog_stopping_background_thread; extern PSI_stage_info stage_binlog_stopping_background_thread;
extern PSI_stage_info stage_waiting_for_work_from_sql_thread; extern PSI_stage_info stage_waiting_for_work_from_sql_thread;
extern PSI_stage_info stage_waiting_for_prior_transaction_to_commit; extern PSI_stage_info stage_waiting_for_prior_transaction_to_commit;
extern PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit;
extern PSI_stage_info stage_waiting_for_room_in_worker_thread; extern PSI_stage_info stage_waiting_for_room_in_worker_thread;
extern PSI_stage_info stage_master_gtid_wait_primary; extern PSI_stage_info stage_master_gtid_wait_primary;
extern PSI_stage_info stage_master_gtid_wait; extern PSI_stage_info stage_master_gtid_wait;
......
...@@ -656,7 +656,7 @@ handle_rpl_parallel_thread(void *arg) ...@@ -656,7 +656,7 @@ handle_rpl_parallel_thread(void *arg)
DEBUG_SYNC(thd, "rpl_parallel_start_waiting_for_prior"); DEBUG_SYNC(thd, "rpl_parallel_start_waiting_for_prior");
thd->ENTER_COND(&gco->COND_group_commit_orderer, thd->ENTER_COND(&gco->COND_group_commit_orderer,
&entry->LOCK_parallel_entry, &entry->LOCK_parallel_entry,
&stage_waiting_for_prior_transaction_to_commit, &stage_waiting_for_prior_transaction_to_start_commit,
&old_stage); &old_stage);
did_enter_cond= true; did_enter_cond= true;
do do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment