From b400ac0f3604937faf29c6cce164fdd8af5e3a8e Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 23 Dec 2022 20:08:32 -0800 Subject: [PATCH] Insert before unlocking new buffer --- src/ivfinsert.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ivfinsert.c b/src/ivfinsert.c index 198b7d6..7394bc0 100644 --- a/src/ivfinsert.c +++ b/src/ivfinsert.c @@ -130,9 +130,14 @@ InsertTuple(Relation rel, IndexTuple itup, Relation heapRel, Datum *values) /* Unlock extend relation lock as early as possible */ UnlockReleaseBuffer(metabuf); - /* Unlock rest */ - UnlockReleaseBuffer(newbuf); + /* Unlock previous buffer */ UnlockReleaseBuffer(buf); + + /* Prepare new buffer */ + state = GenericXLogStart(rel); + buf = newbuf; + page = GenericXLogRegisterBuffer(state, buf, 0); + break; } }