Open fake-name opened 7 years ago
I haven't really touched the code since 2012, and while the on-disk format did not change since that time, I'm sure I got some of the details wrong back then. So don't worry, I'm pretty sure the database is fine but pg_check
is somewhat broken. Sorry for the confusion.
I plan to look at the code and fix it, hopefully in not too distant future.
Can you share some simple test case demonstrating the issue? Which PostgreSQL version is that?
9.6.1, iirc.
I kind of assumed it was a pg_check issue, as the table I'm checking was just relocated from one table-space to another.
I don't have a compact test case, unfortunately. I tested on a few small tables, and it passed, but the table in the post is a few tens of gigabytes. The table is created from this project, fwiw (https://github.com/fake-name/ReadableWebProxy/blob/master/common/raw_archive_db.py#L36)
I tried building pg_check with assertions, just to try it.
I bet the immediate issue is with LP_REDIRECT and/or LP_DEAD item pointers that are not handled within bitmap_add_heap_items(). I saw an assertion failure there, which wasn't very hard to fix.
(Obviously what @tvondra says is still true; I just noticed this open issue in passing and thought I'd tell you what I know.)
Relevant table:
Not sure what's going on. Why does reindexing make it worse?