From: Teodor Sigaev Date: Mon, 7 Sep 2015 14:18:26 +0000 (+0300) Subject: Make GIN's cleanup pending list process interruptable X-Git-Tag: REL9_2_14~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ffbc499419710054d1c96403f6d7edecd344994;p=postgresql 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 --- diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 4fe2998cba..7f2e9faebd 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -799,8 +799,7 @@ ginInsertCleanup(GinState *ginstate, */ processPendingPage(&accum, &datums, page, FirstOffsetNumber); - if (vac_delay) - vacuum_delay_point(); + vacuum_delay_point(); /* * Is it time to flush memory to disk? Flush if we are at the end of @@ -840,8 +839,7 @@ ginInsertCleanup(GinState *ginstate, { ginEntryInsert(ginstate, attnum, key, category, list, nlist, NULL); - if (vac_delay) - vacuum_delay_point(); + vacuum_delay_point(); } /* @@ -921,7 +919,7 @@ ginInsertCleanup(GinState *ginstate, /* * Read next page in pending list */ - CHECK_FOR_INTERRUPTS(); + vacuum_delay_point(); buffer = ReadBuffer(index, blkno); LockBuffer(buffer, GIN_SHARE); page = BufferGetPage(buffer);