RE: releasing ParallelApplyTxnHash when pa_launch_parallel_worker returns NULL - Mailing list pgsql-hackers

From houzj.fnst@fujitsu.com
Subject RE: releasing ParallelApplyTxnHash when pa_launch_parallel_worker returns NULL
Date
Msg-id OS0PR01MB5716EECFCEDA36DC126826AF94FC9@OS0PR01MB5716.jpnprd01.prod.outlook.com
Whole thread Raw
In response to releasing ParallelApplyTxnHash when pa_launch_parallel_worker returns NULL  (Ted Yu <yuzhihong@gmail.com>)
Responses Re: releasing ParallelApplyTxnHash when pa_launch_parallel_worker returns NULL
List pgsql-hackers
On Wednesday, January 11, 2023 1:25 AM Ted Yu <yuzhihong@gmail.com> wrote:

> I was reading src/backend/replication/logical/applyparallelworker.c .
> In `pa_allocate_worker`, when pa_launch_parallel_worker returns NULL, I think the `ParallelApplyTxnHash` should be
released.

Thanks for reporting.

ParallelApplyTxnHash is used to cache the state of streaming transactions being
applied. There could be multiple streaming transactions being applied in
parallel and their information were already saved in ParallelApplyTxnHash, so
we should not release them just because we don't have a worker available to
handle a new transaction here.

Best Regards,
Hou zj

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Spinlock is missing when updating two_phase of ReplicationSlot
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: [PATCH] Add overlaps geometric operators that ignore point overlaps