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

Commitd9a622c

Browse files
committed
Fix error handling path in autovacuum launcher
The original code (since00e6a16) was assuming aborting thetransaction in autovacuum launcher was sufficient to release allresources, but in reality the launcher runs quite a lot of code out ofany transactions. Re-introduce individual cleanup calls to make abortmore robust.Reported-by: Robert HaasDiscussion:https://postgr.es/m/CA+TgmobQVbz4K_+RSmiM9HeRKpy3vS5xnbkL95gSEnWijzprKQ@mail.gmail.com
1 parente139f19 commitd9a622c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
#include"storage/proc.h"
9292
#include"storage/procsignal.h"
9393
#include"storage/sinvaladt.h"
94+
#include"storage/smgr.h"
9495
#include"tcop/tcopprot.h"
9596
#include"utils/dsa.h"
9697
#include"utils/fmgroids.h"
@@ -524,6 +525,26 @@ AutoVacLauncherMain(int argc, char *argv[])
524525
/* Abort the current transaction in order to recover */
525526
AbortCurrentTransaction();
526527

528+
/*
529+
* Release any other resources, for the case where we were not in a
530+
* transaction.
531+
*/
532+
LWLockReleaseAll();
533+
pgstat_report_wait_end();
534+
AbortBufferIO();
535+
UnlockBuffers();
536+
if (CurrentResourceOwner)
537+
{
538+
ResourceOwnerRelease(CurrentResourceOwner,
539+
RESOURCE_RELEASE_BEFORE_LOCKS,
540+
false, true);
541+
/* we needn't bother with the other ResourceOwnerRelease phases */
542+
}
543+
AtEOXact_Buffers(false);
544+
AtEOXact_SMgr();
545+
AtEOXact_Files();
546+
AtEOXact_HashTables(false);
547+
527548
/*
528549
* Now return to normal top-level context and clear ErrorContext for
529550
* next time.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp