From: Andres Freund Date: Fri, 7 Apr 2023 08:02:46 +0000 (-0700) Subject: Fix copy-paste bug in 12f3867f553 triggering an assert after a write error X-Git-Tag: REL_16_BETA1~281 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=21d7c05a5cf7637cbdf2739006936bb9d279d505;p=thirdparty%2Fpostgresql.git Fix copy-paste bug in 12f3867f553 triggering an assert after a write error The same condition accidentally was copied to both branches. Manual testing confirms that otherwise the error recovery path works fine. Found while reviewing the logical-decoding-on-standby patch. --- diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 92714a9fe2d..908a8934bd4 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -5199,7 +5199,7 @@ AbortBufferIO(Buffer buf) } else { - Assert(!(buf_state & BM_DIRTY)); + Assert(buf_state & BM_DIRTY); UnlockBufHdr(buf_hdr, buf_state); /* Issue notice if this is not the first failure... */