Skip to content

Commit 1c38453

Browse files
committed
Attempt to fix alignment problem in multixact
1 parent db4ee78 commit 1c38453

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/backend/access/transam/multixact.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@
117117
/*
118118
* The situation for members is a bit more complex: we store one byte of
119119
* additional flag bits for each TransactionId. To do this without getting
120-
* into alignment issues, we store four bytes of flags, and then the
121-
* corresponding 4 Xids. Each such 5-word (20-byte) set we call a "group", and
120+
* into alignment issues, we store eight bytes of flags, and then the
121+
* corresponding 8 Xids. Each such 9-word (20-byte) set we call a "group", and
122122
* are stored as a whole in pages. Thus, with 8kB BLCKSZ, we keep 409 groups
123123
* per page. This wastes 12 bytes per page, but that's OK -- simplicity (and
124124
* performance) trumps space efficiency here.
@@ -132,7 +132,7 @@
132132
#define MXACT_MEMBER_XACT_BITMASK ((1 << MXACT_MEMBER_BITS_PER_XACT) - 1)
133133

134134
/* how many full bytes of flags are there in a group? */
135-
#define MULTIXACT_FLAGBYTES_PER_GROUP 4
135+
#define MULTIXACT_FLAGBYTES_PER_GROUP 8
136136
#define MULTIXACT_MEMBERS_PER_MEMBERGROUP \
137137
(MULTIXACT_FLAGBYTES_PER_GROUP * MXACT_MEMBER_FLAGS_PER_BYTE)
138138
/* size in bytes of a complete group */
@@ -900,6 +900,7 @@ RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset,
900900
memberptr = (TransactionId *)
901901
(MultiXactMemberCtl->shared->page_buffer[slotno] + memberoff);
902902

903+
903904
*memberptr = members[i].xid;
904905

905906
flagsptr = (uint32 *)

0 commit comments

Comments
 (0)