On 04/03/2019 17:53, Heikki Linnakangas wrote:
I tested this patch with your testing patch from the other thread (after
fixing the above), to leave behind incompletely split pages [1]. It
seems that the amcheck code doesn't expect incomplete splits:
postgres=# SELECT gist_index_parent_check('x_c_idx');
ERROR: index "x_c_idx" has inconsistent records
On closer look, I think that was because that testing patch to leave
behind incomplete splits really did corrupt the index. It always
inserted the downlink to the parent, but randomly skipped clearing the
FOLLOW_RIGHT flag and updating the NSN in the child. That's not a valid
combination. To test incomplete splits, you need to skip inserting the
downlink to the parent, too.
- Heikki