fix-gist-corruption-bug.patch
text/x-patch
Filename: fix-gist-corruption-bug.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/access/gist/gist.c | 4 | 1 |
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 79030e7715..d94d9d33a6 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -242,6 +242,9 @@ gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
if (GistFollowRight(page))
elog(ERROR, "concurrent GiST page split was incomplete");
+ /* should never try to insert to a deleted page */
+ Assert(!GistPageIsDeleted(page));
+
*splitinfo = NIL;
/*
@@ -857,7 +860,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace,
*/
}
else if ((GistFollowRight(stack->page) ||
- stack->parent->lsn < GistPageGetNSN(stack->page)) &&
+ stack->parent->lsn < GistPageGetNSN(stack->page)) ||
GistPageIsDeleted(stack->page))
{
/*