Clear 'xid' in dummy async notify entries written to fill up pages
authorHeikki Linnakangas <[email protected]>
Wed, 12 Nov 2025 19:19:03 +0000 (21:19 +0200)
committerHeikki Linnakangas <[email protected]>
Wed, 12 Nov 2025 19:27:05 +0000 (21:27 +0200)
Before we started to freeze async notify entries (commit 8eeb4a0f7c),
no one looked at the 'xid' on an entry with invalid 'dboid'. But now
we might actually need to freeze it later. Initialize them with
InvalidTransactionId to begin with, to avoid that work later.

Álvaro pointed this out in review of commit 8eeb4a0f7c, but I forgot
to include this change there.

Author: Álvaro Herrera <[email protected]>
Discussion: https://www.postgresql.org/message-id/202511071410[email protected]
Backpatch-through: 14

src/backend/commands/async.c

index c0d53976e8c48f571dc43028f414dd6c8cf7e407..10ea65b0a5ac830e8e18c5452e70b0216cdc62fd 100644 (file)
@@ -1470,6 +1470,7 @@ asyncQueueAddEntries(ListCell *nextNotify)
             */
            qe.length = QUEUE_PAGESIZE - offset;
            qe.dboid = InvalidOid;
+           qe.xid = InvalidTransactionId;
            qe.data[0] = '\0';  /* empty channel */
            qe.data[1] = '\0';  /* empty payload */
        }