From 74d0084faef3bc6d748bd1e26e39c2683d27de1a Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Thu, 12 Mar 2026 14:30:13 +0200
Subject: [PATCH 2/4] Avoid padding in xl_multixact_create WAL record

When MultiXactOffset was widened to 64 bits in commit bd8d9c9bdf, the
struct started to need alignment padding for the 'moff' field. Reorder
the fields to avoid it.

Discussion: https://www.postgresql.org/message-id/CALzhyqzKTRVsQGj+qDDRVs3Oo0EvffuQvVO0v4rbpWU=SoXKug@mail.gmail.com
---
 src/include/access/multixact.h     | 2 +-
 src/include/access/xlog_internal.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h
index 2ae8b571dcc..757c631e725 100644
--- a/src/include/access/multixact.h
+++ b/src/include/access/multixact.h
@@ -72,8 +72,8 @@ typedef struct MultiXactMember
 typedef struct xl_multixact_create
 {
 	MultiXactId mid;			/* new MultiXact's ID */
-	MultiXactOffset moff;		/* its starting offset in members file */
 	int32		nmembers;		/* number of member XIDs */
+	MultiXactOffset moff;		/* its starting offset in members file */
 	MultiXactMember members[FLEXIBLE_ARRAY_MEMBER];
 } xl_multixact_create;
 
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 58ae12bb20f..629ac3a7d3e 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -31,7 +31,7 @@
 /*
  * Each page of XLOG file has a header like this:
  */
-#define XLOG_PAGE_MAGIC 0xD11C	/* can be used as WAL version indicator */
+#define XLOG_PAGE_MAGIC 0xD11D	/* can be used as WAL version indicator */
 
 typedef struct XLogPageHeaderData
 {
-- 
2.47.3

