Commit 34402ae3 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix XLogReadBufferForRedoExtended to get cleanup lock when asked to do so.

parent c291503b
...@@ -312,7 +312,10 @@ XLogReadBufferForRedoExtended(XLogRecPtr lsn, XLogRecord *record, ...@@ -312,7 +312,10 @@ XLogReadBufferForRedoExtended(XLogRecPtr lsn, XLogRecord *record,
*buf = XLogReadBufferExtended(rnode, forkno, blkno, mode); *buf = XLogReadBufferExtended(rnode, forkno, blkno, mode);
if (BufferIsValid(*buf)) 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))) if (lsn <= PageGetLSN(BufferGetPage(*buf)))
return BLK_DONE; return BLK_DONE;
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment