diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-02-07 09:58:19 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-02-07 09:58:19 +0530 |
commit | d9d7fe68d35e1e10c7c8276d07f5abf9c477cb13 (patch) | |
tree | 45a577ac285d25cd18d993942bf562fbb2945f7b /src | |
parent | cfcf56f92398c2827fcca9406e7c7ea6caab83c2 (diff) | |
download | postgresql-d9d7fe68d35e1e10c7c8276d07f5abf9c477cb13.tar.gz postgresql-d9d7fe68d35e1e10c7c8276d07f5abf9c477cb13.zip |
Use appropriate wait event when sending data in the apply worker.
Currently, we reuse WAIT_EVENT_LOGICAL_PARALLEL_APPLY_STATE_CHANGE in the
apply worker while sending data to the parallel apply worker via a shared
memory queue. This is not appropriate as one won't be able to distinguish
whether the worker is waiting for sending data or for the state change.
To patch instead uses the wait event WAIT_EVENT_MQ_SEND which has been
already used in blocking mode while sending data via a shared memory
queue.
Author: Hou Zhijie
Reviewed-by: Kuroda Hayato, Amit Kapila
Discussion: https://postgr.es/m/OS0PR01MB57161C680B22E4C591628EE994DA9@OS0PR01MB5716.jpnprd01.prod.outlook.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/logical/applyparallelworker.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/replication/logical/applyparallelworker.c b/src/backend/replication/logical/applyparallelworker.c index e670ec617a4..da437e0bc34 100644 --- a/src/backend/replication/logical/applyparallelworker.c +++ b/src/backend/replication/logical/applyparallelworker.c @@ -1181,8 +1181,7 @@ 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_LOGICAL_PARALLEL_APPLY_STATE_CHANGE); + SHM_SEND_RETRY_INTERVAL_MS, WAIT_EVENT_MQ_SEND); if (rc & WL_LATCH_SET) { |