From e0884c381d3c06c32bbfea6d50d3231f7b3dc213 Mon Sep 17 00:00:00 2001 From: Maxim Orlov Date: Thu, 21 Nov 2024 15:41:45 +0300 Subject: [PATCH] [PGPRO-7565] use 64-bit atomic access for MyPgXact xid/xmin Switch to the pg_atomic_* calls for the xid/xmin. This fixes a transient error due to non-atomic reading of the xid/xmin values from shared memory on 32-bit arch. tags: 64xid --- src/dmq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dmq.c b/src/dmq.c index 163e0a260b..6c72580c6a 100644 --- a/src/dmq.c +++ b/src/dmq.c @@ -1449,7 +1449,11 @@ dmq_receiver_loop(PG_FUNCTION_ARGS) extra = dmq_receiver_start_hook(sender_name); /* do not hold globalxmin. XXX: try to carefully release snaps */ +#ifdef PGPRO_EE + pg_atomic_write_u64(&MyPgXact->xmin, InvalidTransactionId); +#else MyPgXact->xmin = InvalidTransactionId; +#endif for (;;) {