Re: Amcheck verification of GiST and GIN
Tomas Vondra <tomas.vondra@enterprisedb.com>
Attachments
- v28-review-0001-Refactor-amcheck-to-extract-common-lockin.patch (text/x-patch) patch v28-0001
- v28-review-0002-review.patch (text/x-patch) patch v28-0002
- v28-review-0003-pgindent.patch (text/x-patch) patch v28-0003
- v28-review-0004-Add-gist_index_check-function-to-verify-G.patch (text/x-patch) patch v28-0004
- v28-review-0005-review.patch (text/x-patch) patch v28-0005
- v28-review-0006-pgindent.patch (text/x-patch) patch v28-0006
- v28-review-0007-Add-gin_index_parent_check-to-verify-GIN-.patch (text/x-patch) patch v28-0007
- v28-review-0008-review.patch (text/x-patch) patch v28-0008
- v28-review-0009-pgindent.patch (text/x-patch) patch v28-0009
- v28-review-0010-Add-GiST-support-to-pg_amcheck.patch (text/x-patch) patch v28-0010
- v28-review-0011-review.patch (text/x-patch) patch v28-0011
- v28-review-0012-pgindent.patch (text/x-patch) patch v28-0012
- v28-review-0013-assert-in-GIN-debug-message.patch (text/x-patch) patch v28-0013
Hi, On 7/9/24 08:36, Andrey M. Borodin wrote: > > >> On 5 Jul 2024, at 17:27, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote: >> >> There’s one more problem in pg_amcheck’s GiST verification. We must >> check that amcheck is 1.5+ and use GiST verification only in that >> case … > > Done. I’ll set the status to “Needs review”. > I realized amcheck GIN/GiST support would be useful for testing my patches adding parallel builds for these index types, so I decided to take a look at this and do an initial review today. Attached is a patch series with a extra commits to keep the review comments and patches adjusting the formatting by pgindent (the patch seems far enough for this). Let me quickly go through the review comments: 1) Not sure I like 'amcheck.c' very much, I'd probably go with something like 'verify_common.c' to match naming of the other files. But it's just nitpicking and I can live with it. 2) amcheck_lock_relation_and_check seems to be the most important function, yet there's no comment explaining what it does :-( 3) amcheck_lock_relation_and_check still has a TODO to add the correct name of the AM 4) Do we actually need amcheck_index_mainfork_expected as a separate function, or could it be a part of index_checkable? 5) The comment for heaptuplespresent says "debug counter" but that does not really explain what it's for. (I see verify_nbtree has the same comment, but maybe let's improve that.) 6) I'd suggest moving the GISTSTATE + blocknum fields to the beginning of GistCheckState, it seems more natural to start with "generic" fields. 7) I'd adjust the gist_check_parent_keys_consistency comment a bit, to explain what the function does first, and only then explain how. 8) We seem to be copying PageGetItemIdCareful() around, right? And the copy in _gist.c still references nbtree - I guess that's not right. 9) Why is the GIN function called gin_index_parent_check() and not simply gin_index_check() as for the other AMs? 10) The debug in gin_check_posting_tree_parent_keys_consistency triggers assert when running with client_min_messages='debug5', it seems to be accessing bogus item pointers. 11) Why does it add pg_amcheck support only for GiST and not GIN? That's all for now. I'll add this to the stress-testing tests of my index build patches, and if that triggers more issues I'll report those. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
amcheck: Fix posting tree checks in gin_index_check()
- 0cf205e122ae 18.0 landed
-
amcheck: Fix parent key check in gin_index_check()
- cdd1a431f21d 18.0 landed
-
amcheck: Fix checks of entry order for GIN indexes
- 0b54b392334b 18.0 landed
-
amcheck: Remove unused GinScanItem->parentlsn field
- 8dd41c0bff5b 18.0 landed
-
amcheck: Test gin_index_check on a multicolumn index
- c89d6b889ce9 18.0 landed
-
Remove incidental md5() function use from test
- 49b82522f13f 18.0 landed
-
amcheck: Add a GIN index to the CREATE INDEX CONCURRENTLY tests
- 68f97aeadb8e 18.0 landed
-
amcheck: Add a test with GIN index on JSONB data
- ca738bdc4c9d 18.0 landed
-
amcheck: Fix indentation in verify_gin.c
- ec4327d106be 18.0 landed
-
amcheck: Add gin_index_check() to verify GIN index
- 14ffaece0fb5 18.0 landed
-
amcheck: Move common routines into a separate module
- d70b17636ddf 18.0 landed
-
Fix grammar in GIN README
- fb9dff76635d 18.0 landed
-
Avoid amcheck inline compression false positives.
- eba775345d23 12.0 cited