aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-02-14 17:20:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-02-14 17:20:01 +0000
commit2d7f6947293542c3fc55bc95018766bed6532731 (patch)
tree0469abfceb889d53b19339e499f38617698d44d3
parent49758f47032acd18dac564771f850052b524dab8 (diff)
downloadpostgresql-2d7f6947293542c3fc55bc95018766bed6532731.tar.gz
postgresql-2d7f6947293542c3fc55bc95018766bed6532731.zip
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).
-rw-r--r--src/backend/access/nbtree/nbtree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index dd6f1df6d2e..3533b3b5658 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.140 2006/02/12 00:18:17 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.141 2006/02/14 17:20:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -580,8 +580,6 @@ btbulkdelete(PG_FUNCTION_ARGS)
maxoff;
BlockNumber nextpage;
- vacuum_delay_point();
-
ndeletable = 0;
page = BufferGetPage(buf);
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
@@ -638,6 +636,10 @@ btbulkdelete(PG_FUNCTION_ARGS)
}
else
_bt_relbuf(rel, buf);
+
+ /* call vacuum_delay_point while not holding any buffer lock */
+ vacuum_delay_point();
+
/* And advance to next page, if any */
if (nextpage == P_NONE)
break;
@@ -732,6 +734,8 @@ btvacuumcleanup(PG_FUNCTION_ARGS)
Page page;
BTPageOpaque opaque;
+ vacuum_delay_point();
+
/*
* We can't use _bt_getbuf() here because it always applies
* _bt_checkpage(), which will barf on an all-zero page. We want to