1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-09 18:21:05 +03:00

Fix more holes with SLRU code in need of int64 for segment numbers

This is a continuation of c9e24573905b, 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
This commit is contained in:
Michael Paquier 2024-08-19 12:34:18 +09:00
parent 7b063ff26a
commit bd06cc338d
2 changed files with 7 additions and 7 deletions

View File

@ -120,7 +120,7 @@ MultiXactIdToOffsetEntry(MultiXactId multi)
return multi % MULTIXACT_OFFSETS_PER_PAGE; return multi % MULTIXACT_OFFSETS_PER_PAGE;
} }
static inline int static inline int64
MultiXactIdToOffsetSegment(MultiXactId multi) MultiXactIdToOffsetSegment(MultiXactId multi)
{ {
return MultiXactIdToOffsetPage(multi) / SLRU_PAGES_PER_SEGMENT; return MultiXactIdToOffsetPage(multi) / SLRU_PAGES_PER_SEGMENT;
@ -174,7 +174,7 @@ MXOffsetToMemberPage(MultiXactOffset offset)
return offset / MULTIXACT_MEMBERS_PER_PAGE; return offset / MULTIXACT_MEMBERS_PER_PAGE;
} }
static inline int static inline int64
MXOffsetToMemberSegment(MultiXactOffset offset) MXOffsetToMemberSegment(MultiXactOffset offset)
{ {
return MXOffsetToMemberPage(offset) / SLRU_PAGES_PER_SEGMENT; return MXOffsetToMemberPage(offset) / SLRU_PAGES_PER_SEGMENT;
@ -3039,10 +3039,10 @@ SlruScanDirCbFindEarliest(SlruCtl ctl, char *filename, int64 segpage, void *data
static void static void
PerformMembersTruncation(MultiXactOffset oldestOffset, MultiXactOffset newOldestOffset) PerformMembersTruncation(MultiXactOffset oldestOffset, MultiXactOffset newOldestOffset)
{ {
const int maxsegment = MXOffsetToMemberSegment(MaxMultiXactOffset); const int64 maxsegment = MXOffsetToMemberSegment(MaxMultiXactOffset);
int startsegment = MXOffsetToMemberSegment(oldestOffset); int64 startsegment = MXOffsetToMemberSegment(oldestOffset);
int endsegment = MXOffsetToMemberSegment(newOldestOffset); int64 endsegment = MXOffsetToMemberSegment(newOldestOffset);
int segment = startsegment; int64 segment = startsegment;
/* /*
* Delete all the segments but the last one. The last segment can still * Delete all the segments but the last one. The last segment can still

View File

@ -1532,7 +1532,7 @@ restart:
did_write = false; did_write = false;
for (int slotno = 0; slotno < shared->num_slots; slotno++) for (int slotno = 0; slotno < shared->num_slots; slotno++)
{ {
int pagesegno; int64 pagesegno;
int curbank = SlotGetBankNumber(slotno); int curbank = SlotGetBankNumber(slotno);
/* /*