From a9added15d182519059aae9e7598ae2cf14dd8ad Mon Sep 17 00:00:00 2001 From: Maxim Orlov Date: Wed, 25 Feb 2026 18:20:32 +0300 Subject: [PATCH v2 5/5] Avoid misleading user about status of InvalidTransactionId In some cases, we use the access SLRU page without specifying the XID. If an error occurs, you may receive a message about the inability to obtain status of transaction 0, even though the page appears to be sane. To avoid this, use a more general formulation in case XID is invalid. --- src/include/access/slru.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/include/access/slru.h b/src/include/access/slru.h index 67247365d16..9a6c77101c2 100644 --- a/src/include/access/slru.h +++ b/src/include/access/slru.h @@ -166,10 +166,11 @@ typedef SlruCtlData *SlruCtl; static inline char * TransactionIdIoErrorMsg(const void *opaque_data) { - TransactionId xid = opaque_data ? (*(TransactionId *) opaque_data) : - InvalidTransactionId; + if (opaque_data) + return psprintf("could not access status of transaction %u", + *(TransactionId *) opaque_data); - return psprintf("could not access status of transaction %u", xid); + return psprintf("could not access slru entry"); /* InvalidTransactionId */ } /* -- 2.50.1 (Apple Git-155)