Skip to content

Commit da5d434

Browse files
author
Matthias van de Meent
committed
Fix segment argument for smgr slru download functions.
In PG17+ that should be int64, even if it may or may not yet be used for neon-relevant segments.
1 parent 86b00c9 commit da5d434

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/backend/access/transam/slru.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,10 @@ SlruInternalWritePage(SlruCtl ctl, int slotno, SlruWriteAll fdata)
736736
* ereports if some other error happened
737737
*/
738738
static bool
739-
SimpleLruDownloadSegment(SlruCtl ctl, int pageno, char const *path)
739+
SimpleLruDownloadSegment(SlruCtl ctl, int64 pageno, char const *path)
740740
{
741741
SlruShared shared = ctl->shared;
742-
int segno;
742+
int64 segno;
743743

744744
/* If page is greater than latest written page, then do not try to download segment from server */
745745
if (ctl->PagePrecedes(pg_atomic_read_u64(&shared->latest_page_number), pageno))

src/backend/storage/smgr/smgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ smgr_end_unlogged_build(SMgrRelation reln)
11061106
* file and returns 'true'. If the file is not found, returns 'false'.
11071107
*/
11081108
bool
1109-
smgr_read_slru_segment(const char *path, int segno)
1109+
smgr_read_slru_segment(const char *path, int64 segno)
11101110
{
11111111
if (read_slru_segment_hook)
11121112
return read_slru_segment_hook(path, segno);

src/include/storage/smgr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extern finish_unlogged_build_phase_1_hook_type finish_unlogged_build_phase_1_hoo
155155
extern end_unlogged_build_hook_type end_unlogged_build_hook;
156156

157157
/* NEON: Hook for reading an SLRU segment from e.g. remote storage */
158-
typedef bool (*read_slru_segment_hook_type) (const char *path, int segno);
158+
typedef bool (*read_slru_segment_hook_type) (const char *path, int64 segno);
159159
extern read_slru_segment_hook_type read_slru_segment_hook;
160160

161161
/* NEON: Alternative implementation of calculate_database_size(), to make it O(1) */
@@ -217,7 +217,7 @@ extern void smgr_finish_unlogged_build_phase_1(SMgrRelation reln);
217217
extern void smgr_end_unlogged_build(SMgrRelation reln);
218218

219219
/* Neon: Allow on-demand download of SLRU segment data */
220-
extern bool smgr_read_slru_segment(const char *path, int segno);
220+
extern bool smgr_read_slru_segment(const char *path, int64 segno);
221221

222222
static inline void
223223
smgrread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,

0 commit comments

Comments
 (0)