Skip to content

Commit 34402ae

Browse files
committed
Fix XLogReadBufferForRedoExtended to get cleanup lock when asked to do so.
1 parent c291503 commit 34402ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/access/transam/xlogutils.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ XLogReadBufferForRedoExtended(XLogRecPtr lsn, XLogRecord *record,
312312
*buf = XLogReadBufferExtended(rnode, forkno, blkno, mode);
313313
if (BufferIsValid(*buf))
314314
{
315-
LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE);
315+
if (get_cleanup_lock)
316+
LockBufferForCleanup(*buf);
317+
else
318+
LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE);
316319
if (lsn <= PageGetLSN(BufferGetPage(*buf)))
317320
return BLK_DONE;
318321
else

0 commit comments

Comments
 (0)