diff options
| author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-01-20 18:59:37 +0000 |
|---|---|---|
| committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2009-01-20 18:59:37 +0000 |
| commit | b2a667b9ee8ba8d54e92fddcb0ed8d30651be595 (patch) | |
| tree | 6e01c62937710099b373bc9dced2b87027b8cb4c /src/backend/access/heap/heapam.c | |
| parent | b287f0a39eafbd99dd9ac8e83a58234604961b0d (diff) | |
| download | postgresql-b2a667b9ee8ba8d54e92fddcb0ed8d30651be595.tar.gz | |
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.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
| -rw-r--r-- | src/backend/access/heap/heapam.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index c9d655de57..43af0c7e04 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -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: |
