summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 109713315c0..eceab341255 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -3134,6 +3134,10 @@ XLogNeedsFlush(XLogRecPtr record)
*/
if (!XLogInsertAllowed())
{
+ /* Quick exit if already known to be updated or cannot be updated */
+ if (!updateMinRecoveryPoint || record <= LocalMinRecoveryPoint)
+ return false;
+
/*
* An invalid minRecoveryPoint means that we need to recover all the
* WAL, i.e., we're doing crash recovery. We never modify the control
@@ -3143,11 +3147,10 @@ XLogNeedsFlush(XLogRecPtr record)
* it has not replayed all WAL available when doing crash recovery.
*/
if (XLogRecPtrIsInvalid(LocalMinRecoveryPoint) && InRecovery)
+ {
updateMinRecoveryPoint = false;
-
- /* Quick exit if already known to be updated or cannot be updated */
- if (record <= LocalMinRecoveryPoint || !updateMinRecoveryPoint)
return false;
+ }
/*
* Update local copy of minRecoveryPoint. But if the lock is busy,