diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-11-13 17:54:20 +0200 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-11-13 17:54:20 +0200 |
commit | 34402ae351e71f852a6c2fee7861a66d0dbeb24c (patch) | |
tree | 05a7d4cc000541a98b87a616986344b3de5a6e9c /src/backend/access/transam/xlogutils.c | |
parent | c291503b1c8250c7ba6ca900b7ba2f85a64b1eb6 (diff) | |
download | postgresql-34402ae351e71f852a6c2fee7861a66d0dbeb24c.tar.gz postgresql-34402ae351e71f852a6c2fee7861a66d0dbeb24c.zip |
Fix XLogReadBufferForRedoExtended to get cleanup lock when asked to do so.
Diffstat (limited to 'src/backend/access/transam/xlogutils.c')
-rw-r--r-- | src/backend/access/transam/xlogutils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 1a21dac8538..da0e45bfcc6 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -312,7 +312,10 @@ XLogReadBufferForRedoExtended(XLogRecPtr lsn, XLogRecord *record, *buf = XLogReadBufferExtended(rnode, forkno, blkno, mode); if (BufferIsValid(*buf)) { - LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); + if (get_cleanup_lock) + LockBufferForCleanup(*buf); + else + LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE); if (lsn <= PageGetLSN(BufferGetPage(*buf))) return BLK_DONE; else |