mirror of
https://github.com/postgres/postgres.git
synced 2025-06-05 23:56:58 +03:00
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).
This commit is contained in:
parent
efaac136bf
commit
4fc6585cb9
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.132.2.1 2005/11/22 18:23:04 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.132.2.2 2006/02/14 17:20:10 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -619,8 +619,6 @@ btbulkdelete(PG_FUNCTION_ARGS)
|
|||||||
maxoff;
|
maxoff;
|
||||||
BlockNumber nextpage;
|
BlockNumber nextpage;
|
||||||
|
|
||||||
vacuum_delay_point();
|
|
||||||
|
|
||||||
ndeletable = 0;
|
ndeletable = 0;
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||||
@ -679,6 +677,10 @@ btbulkdelete(PG_FUNCTION_ARGS)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
_bt_relbuf(rel, buf);
|
_bt_relbuf(rel, buf);
|
||||||
|
|
||||||
|
/* call vacuum_delay_point while not holding any buffer lock */
|
||||||
|
vacuum_delay_point();
|
||||||
|
|
||||||
/* And advance to next page, if any */
|
/* And advance to next page, if any */
|
||||||
if (nextpage == P_NONE)
|
if (nextpage == P_NONE)
|
||||||
break;
|
break;
|
||||||
@ -772,6 +774,8 @@ btvacuumcleanup(PG_FUNCTION_ARGS)
|
|||||||
Page page;
|
Page page;
|
||||||
BTPageOpaque opaque;
|
BTPageOpaque opaque;
|
||||||
|
|
||||||
|
vacuum_delay_point();
|
||||||
|
|
||||||
buf = _bt_getbuf(rel, blkno, BT_READ);
|
buf = _bt_getbuf(rel, blkno, BT_READ);
|
||||||
page = BufferGetPage(buf);
|
page = BufferGetPage(buf);
|
||||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user