Skip to content
Snippets Groups Projects
Commit 2e5e856f authored by Tom Lane's avatar Tom Lane
Browse files

Marginal cleanup in arrangements for ensuring StrategyHintVacuum is cleared

after an error during VACUUM.  We have a PG_TRY block anyway around the only
call sites, so just reset it in the CATCH clause instead of having
AtEOXact_Buffers blindly do it during xact end.  I think the old code was
actively wrong for the case of a failure during ANALYZE inside a
subtransaction --- the flag wouldn't get cleared until main transaction end.
Probably not worth back-patching though.
parent f2042741
Branches
Tags
No related merge requests found
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.338 2006/08/18 16:09:08 tgl Exp $ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.339 2006/09/17 22:16:22 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -460,6 +460,8 @@ vacuum(VacuumStmt *vacstmt, List *relids) ...@@ -460,6 +460,8 @@ vacuum(VacuumStmt *vacstmt, List *relids)
{ {
/* Make sure cost accounting is turned off after error */ /* Make sure cost accounting is turned off after error */
VacuumCostActive = false; VacuumCostActive = false;
/* And reset buffer replacement strategy, too */
StrategyHintVacuum(false);
PG_RE_THROW(); PG_RE_THROW();
} }
PG_END_TRY(); PG_END_TRY();
...@@ -1173,8 +1175,6 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind) ...@@ -1173,8 +1175,6 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
* Now release the session-level lock on the master table. * Now release the session-level lock on the master table.
*/ */
UnlockRelationIdForSession(&onerelid, lmode); UnlockRelationIdForSession(&onerelid, lmode);
return;
} }
... ...
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.209 2006/07/23 03:07:58 tgl Exp $ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.210 2006/09/17 22:16:22 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1171,9 +1171,6 @@ AtEOXact_Buffers(bool isCommit) ...@@ -1171,9 +1171,6 @@ AtEOXact_Buffers(bool isCommit)
#endif #endif
AtEOXact_LocalBuffers(isCommit); AtEOXact_LocalBuffers(isCommit);
/* Make sure we reset the strategy hint in case VACUUM errored out */
StrategyHintVacuum(false);
} }
/* /*
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment