pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use appropriate wait event when sending data in the apply worker
3+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2023-02-16 fce003cfde  Add a new wait state and use it when sending data in the apply worker.
* pgsql: Use appropriate wait event when sending data in the apply worker
@ 2023-02-07 04:40  Amit Kapila <akapila@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Amit Kapila @ 2023-02-07 04:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d9d7fe68d35e1e10c7c8276d07f5abf9c477cb13

Modified Files
--------------
src/backend/replication/logical/applyparallelworker.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Use appropriate wait event when sending data in the apply worker
@ 2023-02-09 14:26  Robert Haas <robertmhaas@gmail.com>
  parent: Amit Kapila <akapila@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Robert Haas @ 2023-02-09 14:26 UTC (permalink / raw)
  To: Amit Kapila <akapila@postgresql.org>; +Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>

On Mon, Feb 6, 2023 at 11:40 PM Amit Kapila <akapila@postgresql.org> wrote:
> 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.

This is not right at all. You should invent a new wait state if you're
waiting in a new place.

-- 
Robert Haas
EDB: http://www.enterprisedb.com





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Use appropriate wait event when sending data in the apply worker
@ 2023-02-10 02:06  Amit Kapila <amit.kapila16@gmail.com>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Kapila @ 2023-02-10 02:06 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Amit Kapila <akapila@postgresql.org>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>

On Thu, Feb 9, 2023 at 7:56 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Mon, Feb 6, 2023 at 11:40 PM Amit Kapila <akapila@postgresql.org> wrote:
> > 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.
>
> This is not right at all. You should invent a new wait state if you're
> waiting in a new place.
>

This is a misunderstanding on my part to reuse the wait_event for a
similar kind of wait but I got your point and will take care of this.

-- 
With Regards,
Amit Kapila.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-02-10 02:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 04:40 pgsql: Use appropriate wait event when sending data in the apply worker Amit Kapila <akapila@postgresql.org>
2023-02-09 14:26 ` Robert Haas <robertmhaas@gmail.com>
2023-02-10 02:06   ` Amit Kapila <amit.kapila16@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox