[PATCH] Auto vacuum should still run when clock is set back

From: Cliff Clark <Cliff_Clark(at)selinc(dot)com>
To: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Auto vacuum should still run when clock is set back
Date: 2026-03-24 20:38:21
Message-ID: SA1PR22MB5466E3DF88E240271E936E62E548A@SA1PR22MB5466.namprd22.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If the system clock is set back a large amount after PostgreSQL starts up, auto vacuum may stop running for a very long time.

Attached is a small patch to reschedule the auto vacuum workers when the auto vacuum launcher detects that the current time is before the last time it was run.

I tested this with a script that simply updated a bunch of rows in a test table. Without the fix, the database files keep growing, with the fix, the storage used remains stable.

The patch is based on version f227b7b20c36b7348867eec48d539d28cfdf831c on the master branch of the git repo as of this morning.

Thank you,
Cliff Clark

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-03-24 20:47:12 Re: pg_plan_advice
Previous Message Andres Freund 2026-03-24 20:09:37 Re: Adding locks statistics