From 4fc4856849deb51c8d8822d79b6f10d571dab4f6 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Tue, 19 Nov 2019 23:08:14 +0300 Subject: 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 --- src/backend/access/gin/ginxlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/access/gin/ginxlog.c') diff --git a/src/backend/access/gin/ginxlog.c b/src/backend/access/gin/ginxlog.c index 8902602fc75..5bbe5765715 100644 --- a/src/backend/access/gin/ginxlog.c +++ b/src/backend/access/gin/ginxlog.c @@ -528,7 +528,7 @@ ginRedoDeletePage(XLogReaderState *record) { page = BufferGetPage(dbuffer); Assert(GinPageIsData(page)); - GinPageGetOpaque(page)->flags = GIN_DELETED; + GinPageSetDeleted(page); /* * deleteXid field of ginxlogDeletePage was added during backpatching. -- cgit v1.2.3