aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogutils.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-11-13 17:54:20 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-11-13 17:54:20 +0200
commit34402ae351e71f852a6c2fee7861a66d0dbeb24c (patch)
tree05a7d4cc000541a98b87a616986344b3de5a6e9c /src/backend/access/transam/xlogutils.c
parentc291503b1c8250c7ba6ca900b7ba2f85a64b1eb6 (diff)
downloadpostgresql-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.c5
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