Skip to content

Commit 2d7f694

Browse files
committed
Move btbulkdelete's vacuum_delay_point() call to a place in the loop where
we are not holding a buffer content lock; where it was, InterruptHoldoffCount is positive and so we'd not respond to cancel signals as intended. Also add missing vacuum_delay_point() call in btvacuumcleanup. This should fix complaint from Evgeny Gridasov about failure to respond to SIGINT/SIGTERM in a timely fashion (bug #2257).
1 parent 49758f4 commit 2d7f694

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/backend/access/nbtree/nbtree.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.140 2006/02/12 00:18:17 tgl Exp $
15+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.141 2006/02/14 17:20:01 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -580,8 +580,6 @@ btbulkdelete(PG_FUNCTION_ARGS)
580580
maxoff;
581581
BlockNumber nextpage;
582582

583-
vacuum_delay_point();
584-
585583
ndeletable = 0;
586584
page = BufferGetPage(buf);
587585
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
@@ -638,6 +636,10 @@ btbulkdelete(PG_FUNCTION_ARGS)
638636
}
639637
else
640638
_bt_relbuf(rel, buf);
639+
640+
/* call vacuum_delay_point while not holding any buffer lock */
641+
vacuum_delay_point();
642+
641643
/* And advance to next page, if any */
642644
if (nextpage == P_NONE)
643645
break;
@@ -732,6 +734,8 @@ btvacuumcleanup(PG_FUNCTION_ARGS)
732734
Page page;
733735
BTPageOpaque opaque;
734736

737+
vacuum_delay_point();
738+
735739
/*
736740
* We can't use _bt_getbuf() here because it always applies
737741
* _bt_checkpage(), which will barf on an all-zero page. We want to

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