Fix traversing to the deleted GIN page via downlink

Alexander Korotkov <akorotkov@postgresql.org>

Commit: 99f5888d358a5db375ce0299b18fb47ccfa1646c
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2019-11-19T20:47:29Z
Releases: 9.6.17
Fix traversing to the deleted GIN page via downlink

Current GIN code appears to don't handle traversing to the deleted page via
downlink.  This commit fixes that by stepping right from the delete page like
we do in nbtree.

This commit also fixes setting 'deleted' flag to the GIN pages.  Now other page
flags are not erased once page is deleted.  That helps to keep our assertions
true if we arrive deleted page via downlink.

Discussion: https://postgr.es/m/CAPpHfdvMvsw-NcE5bRS7R1BbvA4BxoDnVVjkXC5W0Czvy9LVrg%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Peter Geoghegan
Backpatch-through: 9.4

Files

Discussion