From 3cf39e6ddbece4000ee56a0f79cdbe71fb2865ff Mon Sep 17 00:00:00 2001
From: Robert Haas <rhaas@postgresql.org>
Date: Mon, 2 Jul 2012 15:33:59 -0400
Subject: [PATCH] Fix a stupid bug I introduced into XLogFlush().

Commit f11e8be3e812cdbbc139c1b4e49141378b118dee broke this; it was right
in Peter's original patch, but I messed it up before committing.
---
 src/backend/access/transam/xlog.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index aff6136f9a8..3f3f9a3727b 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -2105,7 +2105,10 @@ XLogFlush(XLogRecPtr record)
 		/* Got the lock; recheck whether request is satisfied */
 		LogwrtResult = XLogCtl->LogwrtResult;
 		if (XLByteLE(record, LogwrtResult.Flush))
+		{
+			LWLockRelease(WALWriteLock);
 			break;
+		}
 
 		/*
 		 * Sleep before flush! By adding a delay here, we may give further
-- 
GitLab