Re: Handle concurrent drop when doing whole database vacuum

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: cca5507 <cca5507(at)qq(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, suryapoondla4 <suryapoondla4(at)gmail(dot)com>
Subject: Re: Handle concurrent drop when doing whole database vacuum
Date: 2026-06-29 16:22:24
Message-ID: CALj2ACW9cafPGVKfRDxAph7=dJdkJ4fTquqpDhR3yHJNcu=tfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sun, Jun 28, 2026 at 9:58 PM cca5507 <cca5507(at)qq(dot)com> wrote:
>
> Remove some outdated comments in v7.

Thanks for putting this together. The patch LGTM.

I verified it catches the vacuum_is_permitted_for_relation callers with no
lock [1]. Also, we now correctly handle concurrently dropped tables -
although we add tables that are dropped concurrently during the pg_class
scan to the vacuumable rels list, vacuum_rel and vacuum_open_relation catch
them and filter them out, instead of erroring out for database-wide vacuum.
[1]
performing post-bootstrap initialization ... ./TRAP: failed
Assert("CheckRelationOidLockedByMe(relid, AccessShareLock, true)"), File:
"vacuum.c", Line: 726, PID: 20830
/local/home/rupiredd/postgres/inst/bin/postgres(ExceptionalCondition+0x9e)[0xc71723]
/local/home/rupiredd/postgres/inst/bin/postgres(vacuum_is_permitted_for_relation+0x5f)[0x779f28]
/local/home/rupiredd/postgres/inst/bin/postgres[0x77a70b]
/local/home/rupiredd/postgres/inst/bin/postgres(vacuum+0x232)[0x779b92]
/local/home/rupiredd/postgres/inst/bin/postgres(ExecVacuum+0xc02)[0x779951]
/local/home/rupiredd/postgres/inst/bin/postgres(standard_ProcessUtility+0x853)[0xa96fc6]
/local/home/rupiredd/postgres/inst/bin/postgres(ProcessUtility+0x104)[0xa9676c]
/local/home/rupiredd/postgres/inst/bin/postgres[0xa9529f]
/local/home/rupiredd/postgres/inst/bin/postgres[0xa954fc]
/local/home/rupiredd/postgres/inst/bin/postgres(PortalRun+0x2c8)[0xa94a46]
/local/home/rupiredd/postgres/inst/bin/postgres[0xa8dd57]
/local/home/rupiredd/postgres/inst/bin/postgres(PostgresMain+0x9f4)[0xa92c6b]
/local/home/rupiredd/postgres/inst/bin/postgres(PostgresMain+0x0)[0xa92277]
/local/home/rupiredd/postgres/inst/bin/postgres(main+0x2ed)[0x82c59b]
/lib64/libc.so.6(__libc_start_main+0xea)[0x7faee3b3c13a]
/local/home/rupiredd/postgres/inst/bin/postgres(_start+0x2a)[0x49867a]

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-06-29 16:30:47 Re: RFC: Logging plan of the running query
Previous Message Rahila Syed 2026-06-29 16:03:02 Re: Allow progress tracking of sub-commands