Commit e2669224 authored by Teodor Sigaev's avatar Teodor Sigaev

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>
parent e9568083
......@@ -810,7 +810,6 @@ ginInsertCleanup(GinState *ginstate,
*/
processPendingPage(&accum, &datums, page, FirstOffsetNumber);
if (vac_delay)
vacuum_delay_point();
/*
......@@ -851,7 +850,6 @@ ginInsertCleanup(GinState *ginstate,
{
ginEntryInsert(ginstate, attnum, key, category,
list, nlist, NULL);
if (vac_delay)
vacuum_delay_point();
}
......@@ -937,7 +935,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment