From: Tom Lane Date: Tue, 14 Feb 2006 17:20:17 +0000 (+0000) Subject: Move btbulkdelete's vacuum_delay_point() call to a place in the loop where X-Git-Tag: REL8_0_8~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5ab0a259780d63f8de7b1734ac246afce9f369d;p=thirdparty%2Fpostgresql.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 988cbc2a218..75a3568fe9d 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.124.4.1 2005/05/07 21:32:53 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.124.4.2 2006/02/14 17:20:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -571,8 +571,6 @@ btbulkdelete(PG_FUNCTION_ARGS) maxoff; BlockNumber nextpage; - vacuum_delay_point(); - ndeletable = 0; page = BufferGetPage(buf); opaque = (BTPageOpaque) PageGetSpecialPointer(page); @@ -631,6 +629,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; @@ -724,6 +726,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);