Skip to content

Commit 7c848c6

Browse files
knizhnikhlinnaka
andcommitted
Update pgxn/neon/pagestore_smgr.c
Co-authored-by: Heikki Linnakangas <[email protected]>
1 parent ff37527 commit 7c848c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pgxn/neon/pagestore_smgr.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,9 @@ zenith_truncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
14361436

14371437
/*
14381438
* Truncate may affect several chunks of relations. So we should either update last written LSN for all of them,
1439-
* either update LSN for "dummy" metadata block. Second approach seems to be more efficient.
1439+
* or update LSN for "dummy" metadata block. Second approach seems more efficient. If the relation is extended
1440+
* again later, the extension will update the last-written LSN for the extended pages, so there's no harm in
1441+
* leaving behind obsolete entries for the truncated chunks.
14401442
*/
14411443
SetLastWrittenLSNForRelation(lsn, reln->smgr_rnode.node, forknum);
14421444

0 commit comments

Comments
 (0)