Subject: [PATCH v2 1/9] Refactor goto into for loop in GetVictimBuffer()

From: Melanie Plageman <[email-masked]>
Date: Tue, 2 Sep 2025 11:00:44 -0400

@@ -731,6 +741,13 @@ StrategyRejectBuffer(BufferAccessStrategy
strategy, BufferDesc *buf, bool from_r
         strategy->buffers[strategy->current] !=3D BufferDescriptorGetBuffe=
r(buf))
         return false;

+    buf_state =3D LockBufHdr(buf);
+    lsn =3D BufferGetLSN(buf);
+    UnlockBufHdr(buf, buf_state);
+
+    if (!XLogNeedsFlush(lsn))
+        return true;

I think this should return false.

I am planning to review the other patches later and this is for the
first patch only.

--
Regards,
Nazir Bilal Yavuz
Microsoft