Make sure we don't skip databases that are supposed to be vacuumed "exactly
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 7 May 2007 20:41:24 +0000 (20:41 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 7 May 2007 20:41:24 +0000 (20:41 +0000)
now".  This can happen if the time granularity is not very high.

Per ITAGAKI Takahiro.

src/backend/postmaster/autovacuum.c

index f447bb14c0b2ab81c27d0ad07b0e24297a88c295..89e9fba9a23b694b2e4efaa4e885b7380581e7da 100644 (file)
@@ -1036,8 +1036,8 @@ do_start_worker(void)
                                 * Skip this database if its next_worker value falls between
                                 * the current time and the current time plus naptime.
                                 */
-                               if (TimestampDifferenceExceeds(current_time,
-                                                                                          dbp->adl_next_worker, 0) &&
+                               if (!TimestampDifferenceExceeds(dbp->adl_next_worker,
+                                                                                          current_time, 0) &&
                                        !TimestampDifferenceExceeds(current_time,
                                                                                                dbp->adl_next_worker,
                                                                                                autovacuum_naptime * 1000))