Checking for missing heap/index files

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Checking for missing heap/index files
Date: 2022-06-08 12:45:59
Message-ID: YqCaBx2XNr79SLMV@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We currently can check for missing heap/index files by comparing
pg_class with the database directory files. However, I am not clear if
this is safe during concurrent DDL. I assume we create the file before
the update to pg_class is visible, but do we always delete the file
after the update to pg_class is visible? I assume any external checking
tool would need to lock the relation to prevent concurrent DDL.

Also, how would it check if the number of extents is correct? Seems we
would need this value to be in pg_class, and have the same update
protections outlined above. Seems that would require heavier locking.

Is this something anyone has even needed or had requested?

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Indecision is a decision. Inaction is an action. Mark Batterson

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2022-06-08 12:58:26 Re: Invalid memory access in pg_stat_get_subscription
Previous Message Peter Eisentraut 2022-06-08 12:33:16 Re: [RFC] building postgres with meson -v8