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

Commit3e0d80f

Browse files
committed
Fix resource management bug with replication=database.
Commit0d8c9c1 allowed BASE_BACKUP toacquire a ResourceOwner without a transaction so that the backupmanifest functionality could use a BufFile, but it overlooked the factthat when a walsender is used with replication=database, it might havea transaction in progress, because in that mode, SQL and replicationcommands can be mixed. Try to fix things up so that the two cleanupmechanisms don't conflict.Per buildfarm member serinus, which triggered the problem whenCREATE_REPLICATION_SLOT failed from inside a transaction. It passedon the subsequent run, so evidently the failure doesn't happen everytime.
1 parentdb1531c commit3e0d80f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/backend/replication/walsender.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,13 @@ WalSndErrorCleanup(void)
315315

316316
replication_active= false;
317317

318-
WalSndResourceCleanup(false);
318+
/*
319+
* If there is a transaction in progress, it will clean up our
320+
* ResourceOwner, but if a replication command set up a resource owner
321+
* without a transaction, we've got to clean that up now.
322+
*/
323+
if (!IsTransactionOrTransactionBlock())
324+
WalSndResourceCleanup(false);
319325

320326
if (got_STOPPING||got_SIGUSR2)
321327
proc_exit(0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp