Skip to content

Commit bd06cc3

Browse files
committed
Fix more holes with SLRU code in need of int64 for segment numbers
This is a continuation of c9e2457, containing changes included into the proposed patch that have been missed in the actual commit. I have managed to miss these diffs while doing a rebase of the original patch. Thanks to Noah Misch, Peter Eisentraut and Alexander Korotkov for the pokes. Discussion: https://postgr.es/m/92fe572d-638e-4162-aef6-1c42a2936f25@eisentraut.org Discussion: https://postgr.es/m/20240810175055.cd.nmisch@google.com Backpatch-through: 17
1 parent 7b063ff commit bd06cc3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/backend/access/transam/multixact.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ MultiXactIdToOffsetEntry(MultiXactId multi)
120120
return multi % MULTIXACT_OFFSETS_PER_PAGE;
121121
}
122122

123-
static inline int
123+
static inline int64
124124
MultiXactIdToOffsetSegment(MultiXactId multi)
125125
{
126126
return MultiXactIdToOffsetPage(multi) / SLRU_PAGES_PER_SEGMENT;
@@ -174,7 +174,7 @@ MXOffsetToMemberPage(MultiXactOffset offset)
174174
return offset / MULTIXACT_MEMBERS_PER_PAGE;
175175
}
176176

177-
static inline int
177+
static inline int64
178178
MXOffsetToMemberSegment(MultiXactOffset offset)
179179
{
180180
return MXOffsetToMemberPage(offset) / SLRU_PAGES_PER_SEGMENT;
@@ -3039,10 +3039,10 @@ SlruScanDirCbFindEarliest(SlruCtl ctl, char *filename, int64 segpage, void *data
30393039
static void
30403040
PerformMembersTruncation(MultiXactOffset oldestOffset, MultiXactOffset newOldestOffset)
30413041
{
3042-
const int maxsegment = MXOffsetToMemberSegment(MaxMultiXactOffset);
3043-
int startsegment = MXOffsetToMemberSegment(oldestOffset);
3044-
int endsegment = MXOffsetToMemberSegment(newOldestOffset);
3045-
int segment = startsegment;
3042+
const int64 maxsegment = MXOffsetToMemberSegment(MaxMultiXactOffset);
3043+
int64 startsegment = MXOffsetToMemberSegment(oldestOffset);
3044+
int64 endsegment = MXOffsetToMemberSegment(newOldestOffset);
3045+
int64 segment = startsegment;
30463046

30473047
/*
30483048
* Delete all the segments but the last one. The last segment can still

src/backend/access/transam/slru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ SlruDeleteSegment(SlruCtl ctl, int64 segno)
15321532
did_write = false;
15331533
for (int slotno = 0; slotno < shared->num_slots; slotno++)
15341534
{
1535-
int pagesegno;
1535+
int64 pagesegno;
15361536
int curbank = SlotGetBankNumber(slotno);
15371537

15381538
/*

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