public inbox for [email protected]
help / color / mirror / Atom feedFrom: Frits Hoogland <[email protected]>
To: [email protected]
Subject: The ability of postgres to determine loss of files of the main fork
Date: Tue, 30 Sep 2025 12:01:40 +0200
Message-ID: <[email protected]> (raw)
Hi hackers,
Postgres determines the availability of the main fork, the actual data file,
upon reading it. This is also what amcheck will detect.
However, if a relation exceeds 1GB and has more than a single data file
segment, there is the option of silent data loss. For example, if a table
consists of five segments and the third one goes missing, a sequential scan
will happily conclude that the table consists only of two segments and won't
report an error. Only an index scan that tries to return a row in the
missing segment will report an error.
Currently, this kind of data loss cannot be detected if you check the
integrity of the table using verify_heapam(). Only if you manually use the
primary key index to obtain data from a missing segment, you will get an error.
Therefore, I would like to request an enhancement: add an option to
verify_heapam() that causes the primary key index to be scanned and makes
sure that all line pointers in the index point to existing tuples.
An alternative might be to track the number of segments of a relation in
pg_class, but that may be difficult to make crash-safe.
Frits Hoogland
view thread (21+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: The ability of postgres to determine loss of files of the main fork
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox