From fce003cfde219b7016140f83f67ebcfdf75aa0dc Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Thu, 16 Feb 2023 07:46:31 +0530 Subject: Add a new wait state and use it when sending data in the apply worker. d9d7fe68d3 made use of an existing wait event when sending data from the apply worker, but we should have invented a new wait event since this is a new place to wait. This patch corrects the mistake by using a new wait event "LogicalApplySendData". Author: Hou Zhijie Reviewed-by: Peter Smith Discussion: https://postgr.es/m/CA+TgmobWzbr9H3yN3dLVckviEZKemPwd+XyCFKEgyZQZhgP66Q@mail.gmail.com --- src/backend/replication/logical/applyparallelworker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/replication/logical/applyparallelworker.c') diff --git a/src/backend/replication/logical/applyparallelworker.c b/src/backend/replication/logical/applyparallelworker.c index da437e0bc34..45186837795 100644 --- a/src/backend/replication/logical/applyparallelworker.c +++ b/src/backend/replication/logical/applyparallelworker.c @@ -1181,7 +1181,8 @@ pa_send_data(ParallelApplyWorkerInfo *winfo, Size nbytes, const void *data) /* Wait before retrying. */ rc = WaitLatch(MyLatch, WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH, - SHM_SEND_RETRY_INTERVAL_MS, WAIT_EVENT_MQ_SEND); + SHM_SEND_RETRY_INTERVAL_MS, + WAIT_EVENT_LOGICAL_APPLY_SEND_DATA); if (rc & WL_LATCH_SET) { -- cgit v1.2.3