RE: releasing ParallelApplyTxnHash when pa_launch_parallel_worker returns NULL
Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
From: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
To: Ted Yu <yuzhihong@gmail.com>
Cc: "akapila@postgresql.org" <akapila@postgresql.org>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-01-11T02:12:40Z
Lists: 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
Commits
-
Avoid creating parallel apply state hash table unless required.
- dca8b01f5f1f 16.0 landed