Make sure we don't skip databases that are supposed to be vacuumed "exactly

now".  This can happen if the time granularity is not very high.

Per ITAGAKI Takahiro.
REL8_3_STABLE
Alvaro Herrera 19 years ago
parent e292090b59
commit 067deaf83d
  1. 6
      src/backend/postmaster/autovacuum.c

@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.45 2007/05/04 02:06:13 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.46 2007/05/07 20:41:24 alvherre Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1036,8 +1036,8 @@ do_start_worker(void)
* Skip this database if its next_worker value falls between * Skip this database if its next_worker value falls between
* the current time and the current time plus naptime. * the current time and the current time plus naptime.
*/ */
if (TimestampDifferenceExceeds(current_time, if (!TimestampDifferenceExceeds(dbp->adl_next_worker,
dbp->adl_next_worker, 0) && current_time, 0) &&
!TimestampDifferenceExceeds(current_time, !TimestampDifferenceExceeds(current_time,
dbp->adl_next_worker, dbp->adl_next_worker,
autovacuum_naptime * 1000)) autovacuum_naptime * 1000))

Loading…
Cancel
Save