1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Disable elog(ERROR|FATAL) in signal handlers in

critical sections of code.
This commit is contained in:
Vadim B. Mikheev
2000-12-03 10:27:29 +00:00
parent 5e3bc5ebcd
commit 65b362fae1
12 changed files with 94 additions and 29 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.69 2000/11/30 08:46:21 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.70 2000/12/03 10:27:26 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -772,6 +772,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
* NO ELOG(ERROR) till right sibling is updated.
*
*/
START_CRIT_CODE;
{
char xlbuf[sizeof(xl_btree_split) +
sizeof(CommandId) + sizeof(RelFileNode) + BLCKSZ];
@@ -870,6 +871,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
/* write and release the old right sibling */
_bt_wrtbuf(rel, sbuf);
}
END_CRIT_CODE;
/* split's done */
return rbuf;
@@ -1162,6 +1164,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
metabuf = _bt_getbuf(rel, BTREE_METAPAGE,BT_WRITE);
/* NO ELOG(ERROR) from here till newroot op is logged */
START_CRIT_CODE;
/* set btree special data */
rootopaque = (BTPageOpaque) PageGetSpecialPointer(rootpage);
@@ -1248,6 +1251,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
_bt_wrtbuf(rel, metabuf);
}
END_CRIT_CODE;
/* write and let go of the new root buffer */
_bt_wrtbuf(rel, rootbuf);

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.42 2000/11/30 08:46:21 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.43 2000/12/03 10:27:26 vadim Exp $
*
* NOTES
* Postgres btree pages look like ordinary relation pages. The opaque
@@ -165,6 +165,7 @@ _bt_getroot(Relation rel, int access)
rootpage = BufferGetPage(rootbuf);
/* NO ELOG(ERROR) till meta is updated */
START_CRIT_CODE;
_bt_pageinit(rootpage, BufferGetPageSize(rootbuf));
rootopaque = (BTPageOpaque) PageGetSpecialPointer(rootpage);
@@ -186,6 +187,7 @@ _bt_getroot(Relation rel, int access)
PageSetLSN(metapg, recptr);
PageSetSUI(metapg, ThisStartUpID);
}
END_CRIT_CODE;
metad->btm_root = rootblkno;
metad->btm_level = 1;
@@ -402,6 +404,7 @@ _bt_pagedel(Relation rel, ItemPointer tid)
page = BufferGetPage(buf);
/* XLOG stuff */
START_CRIT_CODE;
{
xl_btree_delete xlrec;
XLogRecPtr recptr;
@@ -416,6 +419,7 @@ _bt_pagedel(Relation rel, ItemPointer tid)
}
PageIndexTupleDelete(page, offno);
END_CRIT_CODE;
/* write the buffer and release the lock */
_bt_wrtbuf(rel, buf);