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

Use more consistently int64 for page numbers in SLRU-related code

clog.c, async.c and predicate.c included some SLRU page numbers still
handled as 4-byte integers, while int64 should be used for this purpose.

These holes have been introduced in 4ed8f0913b, that has introduced
the use of 8-byte integers for SLRU page numbers, still forgot about the
code paths updated by this commit.

Reported-by: Noah Misch
Author: Aleksander Alekseev, Michael Paquier
Discussion: https://postgr.es/m/20240626002747.dc.nmisch@google.com
Backpatch-through: 17
This commit is contained in:
Michael Paquier
2024-07-23 17:59:20 +09:00
parent 3b279d89cb
commit 165ea79a60
3 changed files with 16 additions and 16 deletions

View File

@@ -344,7 +344,7 @@ static SlruCtlData SerialSlruCtlData;
typedef struct SerialControlData
{
int headPage; /* newest initialized page */
int64 headPage; /* newest initialized page */
TransactionId headXid; /* newest valid Xid in the SLRU */
TransactionId tailXid; /* oldest xmin we might be interested in */
} SerialControlData;
@@ -1035,7 +1035,7 @@ SerialSetActiveSerXmin(TransactionId xid)
void
CheckPointPredicate(void)
{
int truncateCutoffPage;
int64 truncateCutoffPage;
LWLockAcquire(SerialControlLock, LW_EXCLUSIVE);
@@ -1048,7 +1048,7 @@ CheckPointPredicate(void)
if (TransactionIdIsValid(serialControl->tailXid))
{
int tailPage;
int64 tailPage;
tailPage = SerialPage(serialControl->tailXid);