The ability of postgres to determine loss of files of the main fork
От | Frits Hoogland |
---|---|
Тема | The ability of postgres to determine loss of files of the main fork |
Дата | |
Msg-id | 013D63E2-5D75-492E-85FF-1D5CC0148C82@gmail.com обсуждение исходный текст |
Ответы |
Re: The ability of postgres to determine loss of files of the main fork
|
Список | pgsql-hackers |
Hi hackers,
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.
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.
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
В списке pgsql-hackers по дате отправления: