pgvector.git / summary / log / commit / refs

commit    92a671eeb12469cae7785dea701983ee6b4e9f6b
Author:   Andrew Kane <andrew@ankane.org>
Date:     Mon Aug 01 04:36:46 2022 +0000

    Revert "Commit pages with tuple"
    
    This reverts commit 94eeb83abe5c5490cf799fca84e9cbf815ae6b44.


src/ivfinsert.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/ivfinsert.c b/src/ivfinsert.c index 5f1cdfbf..9a0f68cb 100644 --- a/src/ivfinsert.c +++ b/src/ivfinsert.c @@ -60,7 +60,6 @@ static void InsertTuple(Relation rel, IndexTuple itup, Relation heapRel, Datum *values) { Buffer buf; - Buffer prevbuf = InvalidBuffer; Page page; GenericXLogState *state; Size itemsz; @@ -106,18 +105,20 @@ InsertTuple(Relation rel, IndexTuple itup, Relation heapRel, Datum *values) /* Update previous buffer */ IvfflatPageGetOpaque(page)->nextblkno = insertPage; - MarkBufferDirty(buf); /* Init page */ PageInit(newpage, BufferGetPageSize(newbuf), sizeof(IvfflatPageOpaqueData)); IvfflatPageGetOpaque(newpage)->nextblkno = InvalidBlockNumber; IvfflatPageGetOpaque(newpage)->page_id = IVFFLAT_PAGE_ID; - prevbuf = buf; - buf = newbuf; - page = newpage; + /* Commit */ + MarkBufferDirty(buf); + MarkBufferDirty(newbuf); + GenericXLogFinish(state); - break; + /* Unlock */ + UnlockReleaseBuffer(buf); + UnlockReleaseBuffer(newbuf); } } @@ -127,9 +128,6 @@ InsertTuple(Relation rel, IndexTuple itup, Relation heapRel, Datum *values) IvfflatCommitBuffer(buf, state); - if (BufferIsValid(prevbuf)) - UnlockReleaseBuffer(prevbuf); - /* Update the insert page */ if (insertPage != originalInsertPage) IvfflatUpdateList(rel, state, listInfo, insertPage, originalInsertPage, InvalidBlockNumber, MAIN_FORKNUM); [parent: 94eeb83abe5c]