Skip to content

Commit b6e3673

Browse files
committed
Make GIN's cleanup pending list process interruptable
Cleanup process could be called by ordinary insert/update and could take a lot of time. Add vacuum_delay_point() to make this process interruptable. Under vacuum this call will also throttle a vacuum process to decrease system load, called from insert/update it will not throttle, and that reduces a latency. Backpatch for all supported branches. Jeff Janes <jeff.janes@gmail.com>
1 parent 1e03094 commit b6e3673

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/backend/access/gin/ginfast.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,7 @@ ginInsertCleanup(GinState *ginstate,
794794
*/
795795
processPendingPage(&accum, &datums, page, FirstOffsetNumber);
796796

797-
if (vac_delay)
798-
vacuum_delay_point();
797+
vacuum_delay_point();
799798

800799
/*
801800
* Is it time to flush memory to disk? Flush if we are at the end of
@@ -835,8 +834,7 @@ ginInsertCleanup(GinState *ginstate,
835834
{
836835
ginEntryInsert(ginstate, attnum, key, category,
837836
list, nlist, NULL);
838-
if (vac_delay)
839-
vacuum_delay_point();
837+
vacuum_delay_point();
840838
}
841839

842840
/*
@@ -916,7 +914,7 @@ ginInsertCleanup(GinState *ginstate,
916914
/*
917915
* Read next page in pending list
918916
*/
919-
CHECK_FOR_INTERRUPTS();
917+
vacuum_delay_point();
920918
buffer = ReadBuffer(index, blkno);
921919
LockBuffer(buffer, GIN_SHARE);
922920
page = BufferGetPage(buffer);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy