Skip to content

Commit d7526ad

Browse files
knizhnikMMeent
andauthored
Update src/backend/access/transam/xlog.c
Co-authored-by: Matthias van de Meent <[email protected]>
1 parent cca215e commit d7526ad

File tree

1 file changed

+6
-0
lines changed
  • src/backend/access/transam

1 file changed

+6
-0
lines changed

src/backend/access/transam/xlog.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6782,10 +6782,16 @@ GetLastWrittenLSNv(RelFileLocator relfilenode, ForkNumber forknum,
67826782
}
67836783
else
67846784
{
6785+
/* Mark this block's LSN as missing - we'll update the LwLSN for missing blocks in bulk later */
67856786
lsns[i] = InvalidXLogRecPtr;
67866787
missed_keys = true;
67876788
}
67886789
}
6790+
6791+
/*
6792+
* If we had any missing LwLSN entries, we add the missing ones now.
6793+
* By doing the insertions in one batch, we decrease lock contention.
6794+
*/
67896795
if (missed_keys)
67906796
{
67916797
LWLockRelease(LastWrittenLsnLock);

0 commit comments

Comments
 (0)