From: Tom Lane Date: Tue, 14 Feb 2006 17:20:10 +0000 (+0000) Subject: Move btbulkdelete's vacuum_delay_point() call to a place in the loop where X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=0f313afdb5ca88e1a25f74c3059e1e6f0bf54668;p=users%2Fbernd%2Fpostgres.git 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). --- diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 28b9775088..9d44f156f4 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -619,8 +619,6 @@ btbulkdelete(PG_FUNCTION_ARGS) maxoff; BlockNumber nextpage; - vacuum_delay_point(); - ndeletable = 0; page = BufferGetPage(buf); opaque = (BTPageOpaque) PageGetSpecialPointer(page); @@ -679,6 +677,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; @@ -772,6 +774,8 @@ btvacuumcleanup(PG_FUNCTION_ARGS) Page page; BTPageOpaque opaque; + vacuum_delay_point(); + buf = _bt_getbuf(rel, blkno, BT_READ); page = BufferGetPage(buf); opaque = (BTPageOpaque) PageGetSpecialPointer(page);