mirror of
https://github.com/postgres/postgres.git
synced 2025-07-20 05:03:10 +03:00
Add a new option to RestoreBkpBlocks() to indicate if a cleanup lock should
be used instead of the normal exclusive lock, and make WAL redo functions responsible for calling RestoreBkpBlocks(). They know better what kind of a lock they need. At the moment, this just moves things around with no functional change, but makes the hot standby patch that's under review cleaner.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.273 2009/01/01 17:23:35 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.274 2009/01/20 18:59:36 heikki Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@ -4777,6 +4777,8 @@ heap_redo(XLogRecPtr lsn, XLogRecord *record)
|
||||
{
|
||||
uint8 info = record->xl_info & ~XLR_INFO_MASK;
|
||||
|
||||
RestoreBkpBlocks(lsn, record, false);
|
||||
|
||||
switch (info & XLOG_HEAP_OPMASK)
|
||||
{
|
||||
case XLOG_HEAP_INSERT:
|
||||
@ -4816,12 +4818,15 @@ heap2_redo(XLogRecPtr lsn, XLogRecord *record)
|
||||
switch (info & XLOG_HEAP_OPMASK)
|
||||
{
|
||||
case XLOG_HEAP2_FREEZE:
|
||||
RestoreBkpBlocks(lsn, record, false);
|
||||
heap_xlog_freeze(lsn, record);
|
||||
break;
|
||||
case XLOG_HEAP2_CLEAN:
|
||||
RestoreBkpBlocks(lsn, record, true);
|
||||
heap_xlog_clean(lsn, record, false);
|
||||
break;
|
||||
case XLOG_HEAP2_CLEAN_MOVE:
|
||||
RestoreBkpBlocks(lsn, record, true);
|
||||
heap_xlog_clean(lsn, record, true);
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user