mirror of
https://github.com/postgres/postgres.git
synced 2025-12-07 12:02:30 +03:00
Add the "recheck" logic to autovacuum worker code. The worker first builds
its table list and then rechecks pgstat before vacuuming each table to verify that no one has vacuumed the table in the meantime. In the current autovacuum world this only means that a worker will not vacuum a table that a user has vacuumed manually after the worker started. When support for multiple autovacuum workers is introduced, this will reduce the probability of simultaneous workers on the same database doing redundant work.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.150 2007/03/22 19:53:30 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.151 2007/03/28 22:17:12 alvherre Exp $
|
||||
* ----------
|
||||
*/
|
||||
#include "postgres.h"
|
||||
@@ -2328,10 +2328,6 @@ pgstat_setup_memcxt(void)
|
||||
void
|
||||
pgstat_clear_snapshot(void)
|
||||
{
|
||||
/* In an autovacuum worker process we keep the stats forever */
|
||||
if (IsAutoVacuumWorkerProcess())
|
||||
return;
|
||||
|
||||
/* Release memory, if any was allocated */
|
||||
if (pgStatLocalContext)
|
||||
MemoryContextDelete(pgStatLocalContext);
|
||||
|
||||
Reference in New Issue
Block a user