Update pgxn/neon/pagestore_smgr.c

Co-authored-by: Matthias van de Meent <matthias@neon.tech>
This commit is contained in:
Konstantin Knizhnik
2025-07-18 21:29:17 +03:00
committed by Konstantin Knizhnik
parent 9bfba1b087
commit 96df649858

View File

@@ -589,8 +589,15 @@ neon_get_request_lsns(NRelFileInfo rinfo, ForkNumber forknum, BlockNumber blkno,
XLogRecPtr replay_lsn = GetXLogReplayRecPtr(NULL);
if (MIN_BACKEND_PREFETCH_LSN == InvalidXLogRecPtr)
{
/* mark the backend's replay_lsn as "we have a request ongoing", blocking the expiration of any current LSN */
MIN_BACKEND_PREFETCH_LSN = replay_lsn;
/* make sure memory operations are in correct order, even in concurrent systems */
pg_memory_barrier();
/* get the current LSN to register */
replay_lsn = GetXLogReplayRecPtr(NULL);
MIN_BACKEND_PREFETCH_LSN = replay_lsn;
}
for (int i = 0; i < nblocks; i++)
{
neon_request_lsns *result = &output[i];