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

Commitbe72b9c

Browse files
committed
Fix autovacuum work item error handling
In autovacuum's "work item" processing, a few strings were allocated inthe current transaction's memory context, which goes away during errorhandling; if an error happened during execution of the work item, thepfree() calls to clean up afterwards would try to release already-releasedmemory, possibly leading to a crash. In branch master, this was alreadyfixed by commit335f3d0, so backpatch that to REL_10_STABLE to fixthe problem there too.As a secondary problem, verify that the autovacuum worker is connectedto the right database for each work item; otherwise some items would bediscarded by workers in other databases.Reported-by: Justin PryzbyDiscussion:https://postgr.es/m/20171014035732.GB31726@telsasoft.com
1 parent77954f9 commitbe72b9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,6 +2531,8 @@ do_autovacuum(void)
25312531
continue;
25322532
if (workitem->avw_active)
25332533
continue;
2534+
if (workitem->avw_database!=MyDatabaseId)
2535+
continue;
25342536

25352537
/* claim this one, and release lock while performing it */
25362538
workitem->avw_active= true;
@@ -2606,9 +2608,7 @@ perform_work_item(AutoVacuumWorkItem *workitem)
26062608
/*
26072609
* Save the relation name for a possible error message, to avoid a catalog
26082610
* lookup in case of an error. If any of these return NULL, then the
2609-
* relation has been dropped since last we checked; skip it. Note: they
2610-
* must live in a long-lived memory context because we call vacuum and
2611-
* analyze in different transactions.
2611+
* relation has been dropped since last we checked; skip it.
26122612
*/
26132613
Assert(CurrentMemoryContext==AutovacMemCxt);
26142614

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp