Amcheck verification of GiST and GIN

Started by Andrey Borodinalmost 4 years ago92 messageshackers
Jump to latest
#1Andrey Borodin
amborodin@acm.org

Hello world!

Few years ago we had a thread with $subj [0]/messages/by-id/CAF3eApa07-BajjG8+RYx-Dr_cq28ZA0GsZmUQrGu5b2ayRhB5A@mail.gmail.com. A year ago Heikki put a lot of effort in improving GIN checks [1]/messages/by-id/9fdbb584-1e10-6a55-ecc2-9ba8b5dca1cf@iki.fi while hunting a GIN bug.
And in view of some releases with a recommendation to reindex anything that fails or lacks amcheck verification, I decided that I want to review the thread.

PFA $subj incorporating all Heikki's improvements and restored GiST checks. Also I've added heapallindexed verification for GiST. I'm sure that we must add it for GIN too. Yet I do not know how to implement it. Maybe just check that every entry generated from heap present in entry tree? Or that every tids is present in the index?

GiST verification does parent check despite taking only AccessShareLock. It's possible because when the key discrepancy is found we acquire parent tuple with lock coupling. I'm sure that this is correct to check keys this way. And I'm almost sure it will not deadlock, because split is doing the same locking.

What do you think?

Best regards, Andrey Borodin.

[0]: /messages/by-id/CAF3eApa07-BajjG8+RYx-Dr_cq28ZA0GsZmUQrGu5b2ayRhB5A@mail.gmail.com
[1]: /messages/by-id/9fdbb584-1e10-6a55-ecc2-9ba8b5dca1cf@iki.fi

Attachments:

v10-0001-Amcheck-for-GIN-and-GiST.patchapplication/octet-stream; name=v10-0001-Amcheck-for-GIN-and-GiST.patch; x-unix-mode=0644Download+1872-234
#2Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#1)
Re: Amcheck verification of GiST and GIN

On 30 May 2022, at 12:40, Andrey Borodin <x4mmm@yandex-team.ru> wrote:

What do you think?

Hi Andrey!

Here's a version with better tests. I've made sure that GiST tests actually trigger page reuse after deletion. And enhanced comments in both GiST and GIN test scripts. I hope you'll like it.

GIN heapallindexed is still a no-op check. Looking forward to hear any ideas on what it could be.

Best regards, Andrey Borodin.

Attachments:

v11-0001-Amcheck-for-GIN-and-GiST.patchapplication/octet-stream; name=v11-0001-Amcheck-for-GIN-and-GiST.patch; x-unix-mode=0644Download+1947-232
#3Nikolay Samokhvalov
samokhvalov@gmail.com
In reply to: Andrey Borodin (#2)
Re: Amcheck verification of GiST and GIN

On Wed, Jun 22, 2022 at 11:35 AM Andrey Borodin <x4mmm@yandex-team.ru>
wrote:

On 30 May 2022, at 12:40, Andrey Borodin <x4mmm@yandex-team.ru> wrote:

What do you think?

Hi Andrey!

Hi Andrey!

Since you're talking to yourself, just wanted to support you – this is an
important thing, definitely should be very useful for many projects; I hope
to find time to test it in the next few days.

Thanks for working on it.

#4Andres Freund
andres@anarazel.de
In reply to: Andrey Borodin (#2)
Re: Amcheck verification of GiST and GIN

Hi,

I think having amcheck for more indexes is great.

On 2022-06-22 20:40:56 +0300, Andrey Borodin wrote:

diff --git a/contrib/amcheck/amcheck.c b/contrib/amcheck/amcheck.c
new file mode 100644
index 0000000000..7a222719dd
--- /dev/null
+++ b/contrib/amcheck/amcheck.c
@@ -0,0 +1,187 @@
+/*-------------------------------------------------------------------------
+ *
+ * amcheck.c
+ *		Utility functions common to all access methods.

This'd likely be easier to read if the reorganization were split into its own
commit.

I'd also split gin / gist support. It's a large enough patch that that imo
makes reviewing easier.

+void amcheck_lock_relation_and_check(Oid indrelid, IndexCheckableCallback checkable,
+												IndexDoCheckCallback check, LOCKMODE lockmode, void *state)

Might be worth pgindenting - the void for function definitions (but not for
declarations) is typically on its own line in PG code.

+static GistCheckState
+gist_init_heapallindexed(Relation rel)
+{
+	int64		total_pages;
+	int64		total_elems;
+	uint64		seed;
+	GistCheckState result;
+
+	/*
+	* Size Bloom filter based on estimated number of tuples in index
+	*/
+	total_pages = RelationGetNumberOfBlocks(rel);
+	total_elems = Max(total_pages * (MaxOffsetNumber / 5),
+						(int64) rel->rd_rel->reltuples);
+	/* Generate a random seed to avoid repetition */
+	seed = pg_prng_uint64(&pg_global_prng_state);
+	/* Create Bloom filter to fingerprint index */
+	result.filter = bloom_create(total_elems, maintenance_work_mem, seed);
+
+	/*
+	 * Register our own snapshot
+	 */
+	result.snapshot = RegisterSnapshot(GetTransactionSnapshot());

FWIW, comments like this, that just restate exactly what the code does, are
imo not helpful. Also, there's a trailing space :)

Greetings,

Andres Freund

#5Andrey Borodin
amborodin@acm.org
In reply to: Nikolay Samokhvalov (#3)
Re: Amcheck verification of GiST and GIN

On 23 Jun 2022, at 00:27, Nikolay Samokhvalov <samokhvalov@gmail.com> wrote:

Since you're talking to yourself, just wanted to support you – this is an important thing, definitely should be very useful for many projects; I hope to find time to test it in the next few days.

Thanks Nikolay!

On 23 Jun 2022, at 04:29, Andres Freund <andres@anarazel.de> wrote:

Thanks for looking into the patch, Andres!

On 2022-06-22 20:40:56 +0300, Andrey Borodin wrote:

diff --git a/contrib/amcheck/amcheck.c b/contrib/amcheck/amcheck.c
new file mode 100644
index 0000000000..7a222719dd
--- /dev/null
+++ b/contrib/amcheck/amcheck.c
@@ -0,0 +1,187 @@
+/*-------------------------------------------------------------------------
+ *
+ * amcheck.c
+ *		Utility functions common to all access methods.

This'd likely be easier to read if the reorganization were split into its own
commit.

I'd also split gin / gist support. It's a large enough patch that that imo
makes reviewing easier.

I will split the patch in 3 steps:
1. extract generic functions to amcheck.c
2. add gist functions
3. add gin functions
But each this step is just adding few independent files + some lines to Makefile.

I'll fix other notes too in the next version.

Thanks!

Best regards, Andrey Borodin.

#6Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#5)
Re: Amcheck verification of GiST and GIN

On 26 Jun 2022, at 00:10, Andrey Borodin <x4mmm@yandex-team.ru> wrote:

I will split the patch in 3 steps:
1. extract generic functions to amcheck.c
2. add gist functions
3. add gin functions

I'll fix other notes too in the next version.

Done. PFA attached patchset.

Thanks!

Best regards, Andrey Borodin.

Attachments:

v12-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v12-0001-Refactor-amcheck-to-extract-common-locking-routi.patch; x-unix-mode=0644Download+295-229
v12-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v12-0002-Add-gist_index_parent_check-function-to-verify-G.patch; x-unix-mode=0644Download+719-4
v12-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v12-0003-Add-gin_index_parent_check-to-verify-GIN-index.patch; x-unix-mode=0644Download+932-3
#7Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#6)
Re: Amcheck verification of GiST and GIN

On 23 Jul 2022, at 14:40, Andrey Borodin <x4mmm@yandex-team.ru> wrote:

Done. PFA attached patchset.

Best regards, Andrey Borodin.
<v12-0001-Refactor-amcheck-to-extract-common-locking-routi.patch><v12-0002-Add-gist_index_parent_check-function-to-verify-G.patch><v12-0003-Add-gin_index_parent_check-to-verify-GIN-index.patch>

Here's v13. Changes:
1. Fixed passing through downlink in GIN index
2. Fixed GIN tests (one test case was not working)

Thanks to Vitaliy Kukharik for trying this patches.

Best regards, Andrey Borodin.

Attachments:

v13-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v13-0001-Refactor-amcheck-to-extract-common-locking-routi.patch; x-unix-mode=0644Download+295-229
v13-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v13-0002-Add-gist_index_parent_check-function-to-verify-G.patch; x-unix-mode=0644Download+719-4
v13-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v13-0003-Add-gin_index_parent_check-to-verify-GIN-index.patch; x-unix-mode=0644Download+936-4
#8Andres Freund
andres@anarazel.de
In reply to: Andrey Borodin (#7)
Re: Amcheck verification of GiST and GIN

Hi,

On 2022-08-17 17:28:02 +0500, Andrey Borodin wrote:

Here's v13. Changes:
1. Fixed passing through downlink in GIN index
2. Fixed GIN tests (one test case was not working)

Thanks to Vitaliy Kukharik for trying this patches.

Due to the merge of the meson based build, this patch needs to be
adjusted. See
https://cirrus-ci.com/build/6637154947301376

The changes should be fairly simple, just mirroring the Makefile ones.

Greetings,

Andres Freund

#9Andres Freund
andres@anarazel.de
In reply to: Andres Freund (#8)
Re: Amcheck verification of GiST and GIN

Hi,

On 2022-09-22 08:19:09 -0700, Andres Freund wrote:

Hi,

On 2022-08-17 17:28:02 +0500, Andrey Borodin wrote:

Here's v13. Changes:
1. Fixed passing through downlink in GIN index
2. Fixed GIN tests (one test case was not working)

Thanks to Vitaliy Kukharik for trying this patches.

Due to the merge of the meson based build, this patch needs to be
adjusted. See
https://cirrus-ci.com/build/6637154947301376

The changes should be fairly simple, just mirroring the Makefile ones.

Here's an updated patch adding meson compat.

I didn't fix the following warnings:

[25/28 3 89%] Compiling C object contrib/amcheck/amcheck.dll.p/amcheck.c.obj
../../home/andres/src/postgresql/contrib/amcheck/amcheck.c: In function ‘amcheck_lock_relation_and_check’:
../../home/andres/src/postgresql/contrib/amcheck/amcheck.c:81:20: warning: implicit declaration of function ‘NewGUCNestLevel’ [-Wimplicit-function-declaration]
81 | save_nestlevel = NewGUCNestLevel();
| ^~~~~~~~~~~~~~~
../../home/andres/src/postgresql/contrib/amcheck/amcheck.c:124:2: warning: implicit declaration of function ‘AtEOXact_GUC’; did you mean ‘AtEOXact_SMgr’? [-Wimplicit-function-declaration]
124 | AtEOXact_GUC(false, save_nestlevel);
| ^~~~~~~~~~~~
| AtEOXact_SMgr
[26/28 2 92%] Compiling C object contrib/amcheck/amcheck.dll.p/verify_gin.c.obj
../../home/andres/src/postgresql/contrib/amcheck/verify_gin.c: In function ‘gin_check_parent_keys_consistency’:
../../home/andres/src/postgresql/contrib/amcheck/verify_gin.c:423:8: warning: unused variable ‘heapallindexed’ [-Wunused-variable]
423 | bool heapallindexed = *((bool*)callback_state);
| ^~~~~~~~~~~~~~
[28/28 1 100%] Linking target contrib/amcheck/amcheck.dll

Greetings,

Andres Freund

Attachments:

v14-0002-Add-gist_index_parent_check-function-to-verify-G.patchtext/x-diff; charset=us-asciiDownload+722-4
v14-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchtext/x-diff; charset=us-asciiDownload+938-4
v14-0001-Refactor-amcheck-to-extract-common-locking-routi.patchtext/x-diff; charset=us-asciiDownload+297-230
#10Andrey Borodin
amborodin@acm.org
In reply to: Andres Freund (#9)
Re: Amcheck verification of GiST and GIN

On Sun, Oct 2, 2022 at 12:12 AM Andres Freund <andres@anarazel.de> wrote:

Here's an updated patch adding meson compat.

Thank you, Andres! Here's one more rebase (something was adjusted in
amcheck build).
Also I've fixed new warnings except warning about absent
heapallindexed for GIN. It's a TODO.

Thanks!

Best regards, Andrey Borodin.

Attachments:

v15-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v15-0002-Add-gist_index_parent_check-function-to-verify-G.patchDownload+722-4
v15-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v15-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchDownload+938-4
v15-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v15-0001-Refactor-amcheck-to-extract-common-locking-routi.patchDownload+296-229
In reply to: Andrey Borodin (#10)
Re: Amcheck verification of GiST and GIN

Hello.

I reviewed this patch and I would like to share some comments.

It compiled with those 2 warnings:

verify_gin.c: In function 'gin_check_parent_keys_consistency':
verify_gin.c:481:38: warning: declaration of 'maxoff' shadows a previous
local [-Wshadow=compatible-local]
481 | OffsetNumber maxoff =
PageGetMaxOffsetNumber(page);
| ^~~~~~
verify_gin.c:453:41: note: shadowed declaration is here
453 | maxoff;
| ^~~~~~
verify_gin.c:423:25: warning: unused variable 'heapallindexed'
[-Wunused-variable]
423 | bool heapallindexed = *((bool*)callback_state);
| ^~~~~~~~~~~~~~

Also, I'm not sure about postgres' headers conventions, inside amcheck.h,
there is "miscadmin.h" included, and inside verify_gin.c, verify_gist.h
and verify_nbtree.c both amcheck.h and miscadmin.h are included.

About the documentation, the bt_index_parent_check has comments about the
ShareLock and "SET client_min_messages = DEBUG1;", and both
gist_index_parent_check and gin_index_parent_check lack it. verify_gin
uses DEBUG3, I'm not sure if it is on purpose, but it would be nice to
document it or put DEBUG1 to be consistent.

I lack enough context to do a deep review on the code, so in this area
this patch needs more eyes.

I did the following test:

postgres=# create table teste (t text, tv tsvector);
CREATE TABLE
postgres=# insert into teste values ('hello', 'hello'::tsvector);
INSERT 0 1
postgres=# create index teste_tv on teste using gist(tv);
CREATE INDEX
postgres=# select pg_relation_filepath('teste_tv');
pg_relation_filepath
----------------------
base/5/16441
(1 row)

postgres=#
\q
$ bin/pg_ctl -D data -l log
waiting for server to shut down.... done
server stopped
$ okteta base/5/16441 # I couldn't figure out the dd syntax to change the
1FE9 to '0'
$ bin/pg_ctl -D data -l log
waiting for server to start.... done
server started
$ bin/psql -U ze postgres
psql (16devel)
Type "help" for help.

postgres=# SET client_min_messages = DEBUG3;
SET
postgres=# select gist_index_parent_check('teste_tv'::regclass, true);
DEBUG: verifying that tuples from index "teste_tv" are present in "teste"
ERROR: heap tuple (0,1) from table "teste" lacks matching index tuple
within index "teste_tv"
postgres=#

A simple index corruption in gin:

postgres=# CREATE TABLE "gin_check"("Column1" int[]);
CREATE TABLE
postgres=# insert into gin_check values (ARRAY[1]),(ARRAY[2]);
INSERT 0 2
postgres=# CREATE INDEX gin_check_idx on "gin_check" USING GIN("Column1");
CREATE INDEX
postgres=# select pg_relation_filepath('gin_check_idx');
pg_relation_filepath
----------------------
base/5/16453
(1 row)

postgres=#
\q
$ bin/pg_ctl -D data -l logfile stop
waiting for server to shut down.... done
server stopped
$ okteta data/base/5/16453 # edited some bits near 3FCC
$ bin/pg_ctl -D data -l logfile start
waiting for server to start.... done
server started
$ bin/psql -U ze postgres
psql (16devel)
Type "help" for help.

postgres=# SET client_min_messages = DEBUG3;
SET
postgres=# SELECT gin_index_parent_check('gin_check_idx', true);
ERROR: number of items mismatch in GIN entry tuple, 49 in tuple header, 1
decoded
postgres=#

There are more code paths to follow to check the entire code, and I had a
hard time to corrupt the indices. Is there any automated code to corrupt
index to test such code?

--
Jose Arthur Benetasso Villanova

#12Andrey Borodin
amborodin@acm.org
In reply to: José Arthur Benetasso Villanova (#11)
Re: Amcheck verification of GiST and GIN

Hello!

Thank you for the review!

On Thu, Nov 24, 2022 at 6:04 PM Jose Arthur Benetasso Villanova
<jose.arthur@gmail.com> wrote:

It compiled with those 2 warnings:

verify_gin.c: In function 'gin_check_parent_keys_consistency':
verify_gin.c:481:38: warning: declaration of 'maxoff' shadows a previous
local [-Wshadow=compatible-local]
481 | OffsetNumber maxoff =
PageGetMaxOffsetNumber(page);
| ^~~~~~
verify_gin.c:453:41: note: shadowed declaration is here
453 | maxoff;
| ^~~~~~
verify_gin.c:423:25: warning: unused variable 'heapallindexed'
[-Wunused-variable]

Fixed.

423 | bool heapallindexed = *((bool*)callback_state);
| ^~~~~~~~~~~~~~

This one is in progress yet, heapallindexed check is not implemented yet...

Also, I'm not sure about postgres' headers conventions, inside amcheck.h,
there is "miscadmin.h" included, and inside verify_gin.c, verify_gist.h
and verify_nbtree.c both amcheck.h and miscadmin.h are included.

Fixed.

About the documentation, the bt_index_parent_check has comments about the
ShareLock and "SET client_min_messages = DEBUG1;", and both
gist_index_parent_check and gin_index_parent_check lack it. verify_gin
uses DEBUG3, I'm not sure if it is on purpose, but it would be nice to
document it or put DEBUG1 to be consistent.

GiST and GIN verifications do not take ShareLock for parent checks.
B-tree check cannot verify cross-level invariants between levels when
the index is changing.

GiST verification checks only one invariant that can be verified if
page locks acquired the same way as page split does.
GIN does not require ShareLock because it does not check cross-level invariants.

Reporting progress with DEBUG1 is a good idea, I did not know that
this feature exists. I'll implement something similar in following
versions.

I did the following test:

Cool! Thank you!

There are more code paths to follow to check the entire code, and I had a
hard time to corrupt the indices. Is there any automated code to corrupt
index to test such code?

Heapam tests do this in an automated way, look into this file
t/001_verify_heapam.pl.
Surely we can write these tests. At least automate what you have just
done in the review. However, committing similar checks is a very
tedious work: something will inevitably turn buildfarm red as a
watermelon.

I hope I'll post a version with DEBUG1 reporting and heapallindexed soon.
PFA current state.
Thank you for looking into this!

Best regards, Andrey Borodin.

Attachments:

v16-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v16-0001-Refactor-amcheck-to-extract-common-locking-routi.patchDownload+296-230
v16-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v16-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchDownload+936-4
v16-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v16-0002-Add-gist_index_parent_check-function-to-verify-G.patchDownload+720-4
#13Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#12)
Re: Amcheck verification of GiST and GIN

On Sun, Nov 27, 2022 at 1:29 PM Andrey Borodin <amborodin86@gmail.com> wrote:

GiST verification checks only one invariant that can be verified if
page locks acquired the same way as page split does.
GIN does not require ShareLock because it does not check cross-level invariants.

I was wrong. GIN check does similar gin_refind_parent() to lock pages
in bottom-up manner and truly verify downlink-child_page invariant.

Here's v17. The only difference is that I added progress reporting to
GiST verification.
I still did not implement heapallindexed for GIN. Existence of pending
lists makes this just too difficult for a weekend coding project :(

Thank you!

Best regards, Andrey Borodin.

Attachments:

v17-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v17-0002-Add-gist_index_parent_check-function-to-verify-G.patchDownload+740-4
v17-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v17-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchDownload+936-4
v17-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v17-0001-Refactor-amcheck-to-extract-common-locking-routi.patchDownload+296-230
In reply to: Andrey Borodin (#13)
Re: Amcheck verification of GiST and GIN

On Sun, 27 Nov 2022, Andrey Borodin wrote:

On Sun, Nov 27, 2022 at 1:29 PM Andrey Borodin <amborodin86@gmail.com> wrote:

I was wrong. GIN check does similar gin_refind_parent() to lock pages
in bottom-up manner and truly verify downlink-child_page invariant.

Does this mean that we need the adjustment in docs?

Here's v17. The only difference is that I added progress reporting to
GiST verification.
I still did not implement heapallindexed for GIN. Existence of pending
lists makes this just too difficult for a weekend coding project :(

Thank you!

Best regards, Andrey Borodin.

I'm a bit lost here. I tried your patch again and indeed the
heapallindexed inside gin_check_parent_keys_consistency has a TODO
comment, but it's unclear to me if you are going to implement it or if the
patch "needs review". Right now it's "Waiting on Author".

--
Jose Arthur Benetasso Villanova

#15Robert Haas
robertmhaas@gmail.com
In reply to: José Arthur Benetasso Villanova (#14)
Re: Amcheck verification of GiST and GIN

On Wed, Dec 14, 2022 at 7:19 AM Jose Arthur Benetasso Villanova
<jose.arthur@gmail.com> wrote:

I'm a bit lost here. I tried your patch again and indeed the
heapallindexed inside gin_check_parent_keys_consistency has a TODO
comment, but it's unclear to me if you are going to implement it or if the
patch "needs review". Right now it's "Waiting on Author".

FWIW, I don't think there's a hard requirement that every index AM
needs to support the same set of amcheck options. Where it makes sense
and can be done in a reasonably straightforward manner, we should. But
sometimes that may not be the case, and that seems fine, too.

--
Robert Haas
EDB: http://www.enterprisedb.com

#16Andrey Borodin
amborodin@acm.org
In reply to: José Arthur Benetasso Villanova (#14)
Re: Amcheck verification of GiST and GIN

Hi Jose, thank you for review and sorry for so long delay to answer.

On Wed, Dec 14, 2022 at 4:19 AM Jose Arthur Benetasso Villanova
<jose.arthur@gmail.com> wrote:

On Sun, 27 Nov 2022, Andrey Borodin wrote:

On Sun, Nov 27, 2022 at 1:29 PM Andrey Borodin <amborodin86@gmail.com> wrote:

I was wrong. GIN check does similar gin_refind_parent() to lock pages
in bottom-up manner and truly verify downlink-child_page invariant.

Does this mean that we need the adjustment in docs?

It seems to me that gin_index_parent_check() docs are correct.

Here's v17. The only difference is that I added progress reporting to
GiST verification.
I still did not implement heapallindexed for GIN. Existence of pending
lists makes this just too difficult for a weekend coding project :(

Thank you!

Best regards, Andrey Borodin.

I'm a bit lost here. I tried your patch again and indeed the
heapallindexed inside gin_check_parent_keys_consistency has a TODO
comment, but it's unclear to me if you are going to implement it or if the
patch "needs review". Right now it's "Waiting on Author".

Please find the attached new version. In this patchset heapallindexed
flag is removed from GIN checks.

Thank you!

Best regards, Andrey Borodin.

Attachments:

v18-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v18-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchDownload+936-4
v18-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v18-0002-Add-gist_index_parent_check-function-to-verify-G.patchDownload+740-4
v18-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v18-0001-Refactor-amcheck-to-extract-common-locking-routi.patchDownload+296-230
#17Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#16)
Re: Amcheck verification of GiST and GIN

On Sun, Jan 8, 2023 at 8:05 PM Andrey Borodin <amborodin86@gmail.com> wrote:

Please find the attached new version. In this patchset heapallindexed
flag is removed from GIN checks.

Uh... sorry, git-formatted wrong branch.
Here's the correct version. Double checked.

Best regards, Andrey Borodin.

Attachments:

v19-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v19-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchDownload+931-4
v19-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v19-0001-Refactor-amcheck-to-extract-common-locking-routi.patchDownload+296-230
v19-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v19-0002-Add-gist_index_parent_check-function-to-verify-G.patchDownload+740-4
In reply to: Andrey Borodin (#17)
Re: Amcheck verification of GiST and GIN

On Sun, 8 Jan 2023, Andrey Borodin wrote:

On Sun, Jan 8, 2023 at 8:05 PM Andrey Borodin <amborodin86@gmail.com> wrote:

Please find the attached new version. In this patchset heapallindexed
flag is removed from GIN checks.

Uh... sorry, git-formatted wrong branch.
Here's the correct version. Double checked.

Hello again.

I applied the patch without errors / warnings and did the same tests. All
working as expected.

The only thing that I found is the gin_index_parent_check function in docs
still references the "gin_index_parent_check(index regclass,
heapallindexed boolean) returns void"

--
Jose Arthur Benetasso Villanova

#19Andrey Borodin
amborodin@acm.org
In reply to: José Arthur Benetasso Villanova (#18)
Re: Amcheck verification of GiST and GIN

On Fri, Jan 13, 2023 at 3:46 AM Jose Arthur Benetasso Villanova
<jose.arthur@gmail.com> wrote:

The only thing that I found is the gin_index_parent_check function in docs
still references the "gin_index_parent_check(index regclass,
heapallindexed boolean) returns void"

Correct! Please find the attached fixed version.

Thank you!

Best regards, Andrey Borodin.

Attachments:

v20-0001-Refactor-amcheck-to-extract-common-locking-routi.patchapplication/octet-stream; name=v20-0001-Refactor-amcheck-to-extract-common-locking-routi.patchDownload+296-230
v20-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchapplication/octet-stream; name=v20-0003-Add-gin_index_parent_check-to-verify-GIN-index.patchDownload+931-4
v20-0002-Add-gist_index_parent_check-function-to-verify-G.patchapplication/octet-stream; name=v20-0002-Add-gist_index_parent_check-function-to-verify-G.patchDownload+740-4
In reply to: Andrey Borodin (#19)
Re: Amcheck verification of GiST and GIN

On Fri, 13 Jan 2023, Andrey Borodin wrote:

On Fri, Jan 13, 2023 at 3:46 AM Jose Arthur Benetasso Villanova
<jose.arthur@gmail.com> wrote:

The only thing that I found is the gin_index_parent_check function in docs
still references the "gin_index_parent_check(index regclass,
heapallindexed boolean) returns void"

Correct! Please find the attached fixed version.

Thank you!

Best regards, Andrey Borodin.

Hello again. I see the change. Thanks

--
Jose Arthur Benetasso Villanova

#21Andrey Borodin
amborodin@acm.org
In reply to: José Arthur Benetasso Villanova (#20)
#22Aleksander Alekseev
aleksander@timescale.com
In reply to: Andrey Borodin (#21)
In reply to: Andrey Borodin (#21)
In reply to: Peter Geoghegan (#23)
#25Nikolay Samokhvalov
samokhvalov@gmail.com
In reply to: Peter Geoghegan (#24)
In reply to: Nikolay Samokhvalov (#25)
#27Nikolay Samokhvalov
samokhvalov@gmail.com
In reply to: Peter Geoghegan (#26)
In reply to: Nikolay Samokhvalov (#27)
In reply to: Peter Geoghegan (#24)
#30Andrey Borodin
amborodin@acm.org
In reply to: Peter Geoghegan (#29)
#31Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#30)
#32Michael Banck
michael.banck@credativ.de
In reply to: Nikolay Samokhvalov (#27)
In reply to: Andrey Borodin (#31)
In reply to: Peter Geoghegan (#33)
#35Andrey Borodin
amborodin@acm.org
In reply to: Peter Geoghegan (#34)
#36Andrey Borodin
amborodin@acm.org
In reply to: Peter Geoghegan (#34)
#37Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#36)
In reply to: Andrey Borodin (#36)
#39Alexander Lakhin
exclusion@gmail.com
In reply to: Andrey Borodin (#37)
#40vignesh C
vignesh21@gmail.com
In reply to: Andrey Borodin (#37)
#41Andrey Borodin
amborodin@acm.org
In reply to: vignesh C (#40)
#42Andrey Borodin
amborodin@acm.org
In reply to: Alexander Lakhin (#39)
#43Andrey Borodin
amborodin@acm.org
In reply to: Andrey Borodin (#42)
#44Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Andrey Borodin (#43)
#45Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Tomas Vondra (#44)
#46Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Tomas Vondra (#45)
#47Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Tomas Vondra (#46)
#48Andrey Borodin
amborodin@acm.org
In reply to: Tomas Vondra (#44)
#49Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Andrey Borodin (#48)
#50Kirill Reshke
reshkekirill@gmail.com
In reply to: Tomas Vondra (#49)
#51Kirill Reshke
reshkekirill@gmail.com
In reply to: Andrey Borodin (#48)
#52Andrey Borodin
amborodin@acm.org
In reply to: Kirill Reshke (#51)
#53Kirill Reshke
reshkekirill@gmail.com
In reply to: Andrey Borodin (#52)
#54Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#51)
#55Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#51)
#56Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#55)
#57Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#56)
#58Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#57)
#59Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#58)
#60Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Kirill Reshke (#59)
#61Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Tomas Vondra (#60)
#62Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Mark Dilger (#61)
#63Andrey Borodin
amborodin@acm.org
In reply to: Tomas Vondra (#60)
#64Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Mark Dilger (#61)
#65Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Mark Dilger (#64)
#66Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Mark Dilger (#65)
#67Kirill Reshke
reshkekirill@gmail.com
In reply to: Mark Dilger (#66)
#68Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Kirill Reshke (#67)
#69Kirill Reshke
reshkekirill@gmail.com
In reply to: Mark Dilger (#68)
#70Mark Dilger
mark.dilger@enterprisedb.com
In reply to: Tomas Vondra (#60)
#71Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Mark Dilger (#70)
#72Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Tomas Vondra (#71)
#73Kirill Reshke
reshkekirill@gmail.com
In reply to: Tomas Vondra (#72)
#74Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Kirill Reshke (#73)
#75Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tomas Vondra (#74)
#76Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Tom Lane (#75)
#77Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Tomas Vondra (#76)
#78Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Arseniy Mukhin (#77)
#79Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Arseniy Mukhin (#77)
#80Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Tomas Vondra (#79)
#81Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Arseniy Mukhin (#80)
#82Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Arseniy Mukhin (#81)
#83Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Tomas Vondra (#82)
#84Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Tomas Vondra (#83)
#85Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Arseniy Mukhin (#84)
#86Andrey Borodin
amborodin@acm.org
In reply to: Arseniy Mukhin (#85)
#87Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Andrey Borodin (#86)
#88Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Arseniy Mukhin (#87)
#89Arseniy Mukhin
arseniy.mukhin.dev@gmail.com
In reply to: Tomas Vondra (#88)
#90Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Arseniy Mukhin (#89)
#91Thom Brown
thom@linux.com
In reply to: Tomas Vondra (#90)
#92Tomas Vondra
tomas.vondra@2ndquadrant.com
In reply to: Thom Brown (#91)