Skip to content

Commit 5b2b444

Browse files
committed
Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.
The value when BLCKSZ = 8192 is unchanged, but with larger-than-normal block sizes we might need to crank things back a bit, as we'll have more entries per page than normal in that case. Kevin Grittner
1 parent a195e3c commit 5b2b444

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/storage/lmgr/predicate.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,13 @@ static SlruCtlData OldSerXidSlruCtlData;
305305
#define OLDSERXID_PAGESIZE BLCKSZ
306306
#define OLDSERXID_ENTRYSIZE sizeof(SerCommitSeqNo)
307307
#define OLDSERXID_ENTRIESPERPAGE (OLDSERXID_PAGESIZE / OLDSERXID_ENTRYSIZE)
308-
#define OLDSERXID_MAX_PAGE (SLRU_PAGES_PER_SEGMENT * 0x10000 - 1)
308+
309+
/*
310+
* Set maximum pages based on the lesser of the number needed to track all
311+
* transactions and the maximum that SLRU supports.
312+
*/
313+
#define OLDSERXID_MAX_PAGE Min(SLRU_PAGES_PER_SEGMENT * 0x10000 - 1, \
314+
(MaxTransactionId + 1) / OLDSERXID_ENTRIESPERPAGE - 1)
309315

310316
#define OldSerXidNextPage(page) (((page) >= OLDSERXID_MAX_PAGE) ? 0 : (page) + 1)
311317

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy