Re: pg_amcheck contrib application
Peter Geoghegan <pg@bowt.ie>
On Thu, Mar 4, 2021 at 7:29 AM Robert Haas <robertmhaas@gmail.com> wrote: > I think this whole approach is pretty suspect because the number of > blocks in the relation can increase (by relation extension) or > decrease (by VACUUM or TRUNCATE) between the time when we query for > the list of target relations and the time we get around to executing > any queries against them. I think it's OK to use the number of > relation pages for progress reporting because progress reporting is > only approximate anyway, but I wouldn't print them out in the progress > messages, and I wouldn't try to fix up the startblock and endblock > arguments on the basis of how long you think that relation is going to > be. I don't think that the struct AmcheckOptions block fields (e.g., startblock) should be of type 'long' -- that doesn't work well on Windows, where 'long' is only 32-bit. To be fair we already do the same thing elsewhere, but there is no reason to repeat those mistakes. (I'm rather suspicious of 'long' in general.) I think that you could use BlockNumber + strtoul() without breaking Windows. > There are a LOT of things that can go wrong when we go try to run > verify_heapam on a table. The table might have been dropped; in fact, > on a busy production system, such cases are likely to occur routinely > if DDL is common, which for many users it is. The system catalog > entries might be screwed up, so that the relation can't be opened. > There might be an unreadable page in the relation, either because the > OS reports an I/O error or something like that, or because checksum > verification fails. There are various other possibilities. We > shouldn't view such errors as low-level things that occur only in > fringe cases; this is a corruption-checking tool, and we should expect > that running it against messed-up databases will be common. We > shouldn't try to interpret the errors we get or make any big decisions > about them, but we should have a clear way of reporting them so that > the user can decide what to do. I agree. Your database is not supposed to be corrupt. Once your database has become corrupt, all bets are off -- something happened that was supposed to be impossible -- which seems like a good reason to be modest about what we think we know. The user should always see the unvarnished truth. pg_amcheck should not presume to suppress errors from lower level code, except perhaps in well-scoped special cases. -- Peter Geoghegan
Commits
-
amcheck: Improve some confusing reports about TOAST problems.
- 50529e5b4e39 14.0 landed
-
amcheck: Reword some messages and fix an alignment problem.
- 9acaf1a62197 14.0 landed
-
amcheck: fix multiple problems with TOAST pointer validation
- ec7ffb8096e8 14.0 landed
-
amcheck: Remove duplicate XID/MXID bounds checks.
- 4573f6a9af6e 14.0 landed
-
amcheck: Fix verify_heapam's tuple visibility checking rules.
- 3b6c1259f9ca 14.0 landed
-
nbtree VACUUM: Cope with buggy opclasses.
- 5b861baa550a 14.0 landed
-
Improve pg_amcheck's TAP test 003_check.pl.
- 87d90ac61fa1 14.0 landed
-
Fix a confusing amcheck corruption message.
- 4078ce65a0f7 14.0 landed
-
Doc: add note about how to run the pg_amcheck regression tests.
- 58f57490facd 14.0 cited
-
In pg_amcheck tests, don't depend on perl's Q/q pack code.
- 945d2cb7d025 14.0 landed
-
pg_amcheck: Keep trying to fix the tests.
- 9e294d0f34d6 14.0 landed
-
pg_amcheck: Try to fix still more test failures.
- 24189277f6ff 14.0 landed
-
Try to avoid apparent platform-dependency in IPC::Run
- f371a4cdba6d 14.0 landed
-
Fix portability issues in pg_amcheck's 004_verify_heapam.pl.
- 661125612706 14.0 landed
-
Try to fix compiler warnings.
- d60e61de4fb4 14.0 landed
-
Add pg_amcheck, a CLI for contrib/amcheck.
- 9706092839db 14.0 landed
-
Refactor and generalize the ParallelSlot machinery.
- f71519e545a3 14.0 landed
-
Remove old-style VACUUM FULL (which was known for a little while as
- 0a469c87692d 9.0.0 cited