Restored interrupts [skip ci]

This commit is contained in:
Andrew Kane
2023-08-01 19:53:45 -07:00
parent e2a8dd6594
commit 3169a60e5c

View File

@@ -84,6 +84,12 @@ HnswBuildAppendPage(Relation index, Buffer *buf, Page *page, GenericXLogState **
GenericXLogFinish(*state);
UnlockReleaseBuffer(*buf);
/* Can take a while, so ensure we can interrupt */
/* Needs to be called when no buffer locks are held */
LockBuffer(newbuf, BUFFER_LOCK_UNLOCK);
CHECK_FOR_INTERRUPTS();
LockBuffer(newbuf, BUFFER_LOCK_EXCLUSIVE);
/* Prepare new page */
*buf = newbuf;
*state = GenericXLogStart(index);
@@ -202,6 +208,10 @@ CreateNeighborPages(HnswBuildState * buildstate)
GenericXLogState *state;
Size neighborsz = HNSW_NEIGHBOR_TUPLE_SIZE(e->level, m);
/* Can take a while, so ensure we can interrupt */
/* Needs to be called when no buffer locks are held */
CHECK_FOR_INTERRUPTS();
buf = ReadBufferExtended(index, forkNum, e->neighborPage, RBM_NORMAL, NULL);
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
state = GenericXLogStart(index);