Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdca8b01

Browse files
author
Amit Kapila
committed
Avoid creating parallel apply state hash table unless required.
This hash table is used to cache the state of streaming transactions beingapplied by the parallel apply workers. So, this should be created onlywhen we are successful in launching at least one worker. This avoids rarecase memory leak when we are never able to launch any worker.Author: Ted YuDiscussion:https://postgr.es/m/CALte62wg0rBR3Vj2beV=HiWo2qG9L0hzKcX=yULNER0wmf4aEw@mail.gmail.com
1 parente753ae6 commitdca8b01

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/replication/logical/applyparallelworker.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ pa_allocate_worker(TransactionId xid)
475475
if (!pa_can_start())
476476
return;
477477

478+
winfo=pa_launch_parallel_worker();
479+
if (!winfo)
480+
return;
481+
478482
/* First time through, initialize parallel apply worker state hashtable. */
479483
if (!ParallelApplyTxnHash)
480484
{
@@ -490,10 +494,6 @@ pa_allocate_worker(TransactionId xid)
490494
HASH_ELEM |HASH_BLOBS |HASH_CONTEXT);
491495
}
492496

493-
winfo=pa_launch_parallel_worker();
494-
if (!winfo)
495-
return;
496-
497497
/* Create an entry for the requested transaction. */
498498
entry=hash_search(ParallelApplyTxnHash,&xid,HASH_ENTER,&found);
499499
if (found)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp