mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Disable elog(ERROR|FATAL) in signal handlers in
critical sections of code.
This commit is contained in:
@@ -295,6 +295,7 @@ nextval(PG_FUNCTION_ARGS)
|
||||
elm->last = result; /* last returned number */
|
||||
elm->cached = last; /* last fetched number */
|
||||
|
||||
START_CRIT_CODE;
|
||||
if (logit)
|
||||
{
|
||||
xl_seq_rec xlrec;
|
||||
@@ -318,6 +319,7 @@ nextval(PG_FUNCTION_ARGS)
|
||||
Assert(log >= 0);
|
||||
seq->log_cnt = log; /* how much is logged */
|
||||
seq->is_called = 't';
|
||||
END_CRIT_CODE;
|
||||
|
||||
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
|
||||
|
||||
@@ -386,6 +388,7 @@ do_setval(char *seqname, int32 next, bool iscalled)
|
||||
elm->cached = next; /* last cached number */
|
||||
|
||||
/* save info in sequence relation */
|
||||
START_CRIT_CODE;
|
||||
seq->last_value = next; /* last fetched number */
|
||||
seq->is_called = iscalled ? 't' : 'f';
|
||||
seq->log_cnt = (iscalled) ? 0 : 1;
|
||||
@@ -403,6 +406,7 @@ do_setval(char *seqname, int32 next, bool iscalled)
|
||||
PageSetLSN(BufferGetPage(buf), recptr);
|
||||
PageSetSUI(BufferGetPage(buf), ThisStartUpID);
|
||||
}
|
||||
END_CRIT_CODE;
|
||||
|
||||
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.175 2000/12/02 19:38:34 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.176 2000/12/03 10:27:27 vadim Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1418,6 +1418,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
|
||||
Cpage = BufferGetPage(Cbuf);
|
||||
|
||||
/* NO ELOG(ERROR) TILL CHANGES ARE LOGGED */
|
||||
START_CRIT_CODE;
|
||||
|
||||
Citemid = PageGetItemId(Cpage,
|
||||
ItemPointerGetOffsetNumber(&(tuple.t_self)));
|
||||
@@ -1501,6 +1502,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
|
||||
PageSetLSN(ToPage, recptr);
|
||||
PageSetSUI(ToPage, ThisStartUpID);
|
||||
}
|
||||
END_CRIT_CODE;
|
||||
|
||||
if (((int) destvacpage->blkno) > last_move_dest_block)
|
||||
last_move_dest_block = destvacpage->blkno;
|
||||
@@ -1624,12 +1626,15 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
|
||||
~(HEAP_XMIN_COMMITTED | HEAP_XMIN_INVALID | HEAP_MOVED_OFF);
|
||||
newtup.t_data->t_infomask |= HEAP_MOVED_IN;
|
||||
|
||||
/* NO ELOG(ERROR) TILL CHANGES ARE LOGGED */
|
||||
START_CRIT_CODE;
|
||||
|
||||
/* add tuple to the page */
|
||||
newoff = PageAddItem(ToPage, (Item) newtup.t_data, tuple_len,
|
||||
InvalidOffsetNumber, LP_USED);
|
||||
if (newoff == InvalidOffsetNumber)
|
||||
{
|
||||
elog(ERROR, "\
|
||||
elog(STOP, "\
|
||||
failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)",
|
||||
(unsigned long)tuple_len, cur_page->blkno, (unsigned long)cur_page->free,
|
||||
cur_page->offsets_used, cur_page->offsets_free);
|
||||
@@ -1659,6 +1664,7 @@ failed to add item with len = %lu to page %u (free space %lu, nusd %u, noff %u)"
|
||||
PageSetLSN(ToPage, recptr);
|
||||
PageSetSUI(ToPage, ThisStartUpID);
|
||||
}
|
||||
END_CRIT_CODE;
|
||||
|
||||
cur_page->offsets_used++;
|
||||
num_moved++;
|
||||
|
||||
Reference in New Issue
Block a user