Re: pg_amcheck contrib application
Robert Haas <robertmhaas@gmail.com>
On Thu, Mar 4, 2021 at 5:39 PM Mark Dilger <mark.dilger@enterprisedb.com> wrote: > I think Robert mistook why I was doing that. I was thinking about a different usage pattern. If somebody thinks a subset of relations have been badly corrupted, but doesn't know which relations those might be, they might try to find them with pg_amcheck, but wanting to just check the first few blocks per relation in order to sample the relations. So, > > pg_amcheck --startblock=0 --endblock=9 --no-dependent-indexes > > or something like that. I don't think it's very fun to have it error out for each relation that doesn't have at least ten blocks, nor is it fun to have those relations skipped by error'ing out before checking any blocks, as they might be the corrupt relations you are looking for. But using --startblock and --endblock for this is not a natural fit, as evidenced by how I was trying to "fix things up" for the user, so I'll punt on this usage until some future version, when I might add a sampling option. I admit I hadn't thought of that use case. I guess somebody could want to do that, but it doesn't seem all that useful. Checking the first up-to-ten blocks of every relation is not a very representative sample, and it's not clear to me that sampling is a good idea even if it were representative. What good is it to know that 10% of my database is probably not corrupted? On the other hand, people want to do all kinds of things that seem strange to me, and this might be another one. But, if that's so, then I think the right place to implement it is in amcheck itself, not pg_amcheck. I think pg_amcheck should be, now and in the future, a thin wrapper around the functionality provided by amcheck, just providing target selection and parallel execution. If you put something into pg_amcheck that figures out how long the relation is and runs it on some of the blocks, that functionality is only accessible to people who are accessing amcheck via pg_amcheck. If you put it in amcheck itself and just expose it through pg_amcheck, then it's accessible either way. It's probably cleaner and more performant to do it that way, too. So if you did add a sampling option in the future, that's the way I would recommend doing it, but I think it is probably best not to go there right now. -- Robert Haas EDB: http://www.enterprisedb.com
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