Re: new heapcheck contrib module
Peter Geoghegan <pg@bowt.ie>
On Wed, Aug 5, 2020 at 7:09 AM Robert Haas <robertmhaas@gmail.com> wrote: > Not sure I agree with this. As a homeowner, the distinction between 0 > and 1 is less significant to me than the distinction between a few > (preferably in places where I'll never see them) and whole lot. I > agree with you to an extent though: all I really care about is whether > I have too few to worry about, enough that I'd better try to take care > of it somehow, or so many that I need a professional exterminator. If, > however, I were a professional exterminator, I would be unhappy with > just knowing that there are few problems or many. I suspect I would > want to know something about where the problems were, and get a more > nuanced indication of just how bad things are in each location. Right, but the professional exterminator can be expected to use expert level tools, where a great deal of technical sophistication is required to interpret what's going on sensibly. An amatuer can only use them to determine if something is wrong at all, which is usually not how they add value. (I think that my analogy is slightly flawed in that it hinged upon everybody hating cockroaches as much as I do, which is more than the ordinary amount.) > FWIW, pg_catcheck is an example of an existing tool (designed by me > and written partially by me) that uses the kind of model I'm talking > about. It does a single SELECT * FROM pg_<whatever> on each catalog > table - so that it doesn't get confused if your system catalog indexes > are messed up - and then performs a bunch of cross-checks on the > tuples it gets back and tells you about all the messed up stuff. If it > can't get data from all your catalog tables it performs whichever > checks are valid given what data it was able to get. As a professional > exterminator of catalog corruption, I find it quite helpful. I myself seem to have had quite different experiences with corruption, presumably because it happened at product companies like Heroku. I tended to find software bugs (e.g. the one fixed by commit 008c4135) that were rare and novel by casting a wide net over a large number of relatively homogenous databases. Whereas your experiences tend to involve large support customers with more opportunity for operator error. Both perspectives are important. > The second group is a lot harder. It is in general difficult to > speculate about how something that is now wrong got that way given > knowledge only of the present state of affairs. But good tooling makes > it easier to speculate intelligently. To take a classic example, > there's a great difference between a checksum failure caused by the > checksum being incorrect on an otherwise-valid page; a checksum > failure on a page the first half of which appears valid and the second > half of which looks like it might be some other database page; and a > checksum failure on a page whose contents appear to be taken from a > Microsoft Word document. I'm not saying we ever want a tool which > tries to figure that sort of thing out in an automated way; there's no > substitute for human intelligence (yet, anyway). I wrote my own expert level tool, pg_hexedit. I have to admit that the level of interest in that tool doesn't seem to be all that great, though I myself have used it to investigate corruption to great effect. But I suppose there is no way to know how it's being used. -- Peter Geoghegan
Commits
-
Add pg_amcheck, a CLI for contrib/amcheck.
- 9706092839db 14.0 landed
-
Refactor and generalize the ParallelSlot machinery.
- f71519e545a3 14.0 landed
-
Generalize parallel slot result handling.
- 418611c84d00 14.0 landed
-
Move some code from src/bin/scripts to src/fe_utils to permit reuse.
- e955bd4b6c2b 14.0 landed
-
Factor pattern-construction logic out of processSQLNamePattern.
- 2c8726c4b0a4 14.0 landed
-
Doc: clean up verify_heapam() documentation.
- 4c49d8fc15ee 14.0 landed
-
Fix more portability issues in new amcheck code.
- 321633e17b07 14.0 landed
-
Fix portability issues in new amcheck test.
- 860593ec3bd1 14.0 landed
-
Try to avoid a compiler warning about using fxid uninitialized.
- 8bb0c9770e80 14.0 landed
-
Extend amcheck to check heap pages.
- 866e24d47db1 14.0 landed
-
Adjust walsender usage of xlogreader, simplify APIs
- 850196b610d2 13.0 cited
-
Improve checking of child pages in contrib/amcheck.
- d114cc538715 13.0 cited
-
Sanitize line pointers within contrib/amcheck.
- a9ce839a3137 12.0 cited
-
Fix possible sorting error when aborting use of abbreviated keys.
- 008c4135ccf6 10.0 cited