Re: Amcheck verification of GiST and GIN
Kirill Reshke <reshkekirill@gmail.com>
Attachments
- v32-0005-Add-GiST-support-to-pg_amcheck.patch (application/octet-stream) patch v32-0005
- v32-0002-Refactor-amcheck-internals-to-isolate-common-loc.patch (application/octet-stream) patch v32-0002
- v32-0001-A-tiny-nitpicky-tweak-to-beautify-the-Amcheck-in.patch (application/octet-stream) patch v32-0001
- v32-0004-Add-gin_index_check-to-verify-GIN-index.patch (application/octet-stream) patch v32-0004
- v32-0003-Add-gist_index_check-function-to-verify-GiST-ind.patch (application/octet-stream) patch v32-0003
On Fri, 29 Nov 2024 at 22:24, Kirill Reshke <reshkekirill@gmail.com> wrote:
ic(buffer);
> - maxoff = PageGetMaxOffsetNumber(page);
> + maxoff = GinPageGetOpaque(page)->maxoff;
This change was not correct at all.
PFA v32.
Little sketch of what's changed:
1) More debug1-debug3 output added.
2) Assertion failure under debug3 (pointed by Tomas Vonda) resolved
again. The fix is not to call ItemPointerGetOffsetNumber on rightmost
tuple, because,
ItemPointerGetOffsetNumber expects a valid pointer and rightmost tuple
pointer is (0, 0)
3) pgindent run
only 0004 was changed since v31. To clarify, gin_index_check still
does not work under some conditions. So, works on some types of
indexes and does not on others.
I think the issue is around the full entry page.
Repro:
```
db1=# create table ttt(t text);
CREATE TABLE
db1=# create index on ttt using gin(t gin_trgm_ops);
CREATE INDEX
db1=# insert into ttt select md5(random()::text) from generate_series(1,50000);
INSERT 0 50000
db1=# set client_min_messages to debug5;
DEBUG: CommitTransaction(1) name: unnamed; blockState: STARTED;
state: INPROGRESS, xid/subid/cid: 0/1/0
SET
db1=# select gin_index_check('ttt_t_idx');
DEBUG: StartTransaction(1) name: unnamed; blockState: DEFAULT; state:
INPROGRESS, xid/subid/cid: 0/1/0
DEBUG: processing entry tree page at blk 1, maxoff: 2
DEBUG: processing entry tree page at blk 941, maxoff: 229
ERROR: index "ttt_t_idx" has wrong tuple order on entry tree page,
block 941, offset 229
db1=#
```
I have only observed failures on the last tuple of the entry page. All
other known issues that were on v31 are now fixed (I hope).
--
Best regards,
Kirill Reshke
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