Skip to content

Commit 49758f4

Browse files
committed
Add some missing vacuum_delay_point calls in GIST vacuuming.
1 parent 006320e commit 49758f4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/backend/access/gist/gistvacuum.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.14 2006/02/11 23:31:33 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.15 2006/02/14 16:39:32 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -68,6 +68,8 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion)
6868
int ncompleted = 0,
6969
lencompleted = 16;
7070

71+
vacuum_delay_point();
72+
7173
buffer = ReadBuffer(gv->index, blkno);
7274

7375
/*
@@ -406,9 +408,12 @@ gistvacuumcleanup(PG_FUNCTION_ARGS)
406408
freePages = (BlockNumber *) palloc(sizeof(BlockNumber) * maxFreePages);
407409
for (blkno = GIST_ROOT_BLKNO + 1; blkno < npages; blkno++)
408410
{
409-
Buffer buffer = ReadBuffer(rel, blkno);
411+
Buffer buffer;
410412
Page page;
411413

414+
vacuum_delay_point();
415+
416+
buffer = ReadBuffer(rel, blkno);
412417
LockBuffer(buffer, GIST_SHARE);
413418
page = (Page) BufferGetPage(buffer);
414419

@@ -561,7 +566,7 @@ gistbulkdelete(PG_FUNCTION_ARGS)
561566
page = (Page) BufferGetPage(buffer);
562567
if (stack->blkno == GIST_ROOT_BLKNO && !GistPageIsLeaf(page))
563568
{
564-
/* the only root can become non-leaf during relock */
569+
/* only the root can become non-leaf during relock */
565570
LockBuffer(buffer, GIST_UNLOCK);
566571
ReleaseBuffer(buffer);
567572
/* one more check */
@@ -649,7 +654,6 @@ gistbulkdelete(PG_FUNCTION_ARGS)
649654
LockBuffer(buffer, GIST_UNLOCK);
650655
ReleaseBuffer(buffer);
651656

652-
653657
ptr = stack->next;
654658
pfree(stack);
655659
stack = ptr;

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