From 403b86c9b072cce8ba891b12d75be05d9b97eb45 Mon Sep 17 00:00:00 2001 From: Jingtang Zhang Date: Mon, 29 Jun 2026 17:08:52 +0800 Subject: [PATCH 1/2] hio: Include last block in FSM vacuum range RelationAddBlocks() records free space for every block it adds to the FSM, then asks FreeSpaceMapVacuumRange() to propagate the affected range. The range endpoint is exclusive, so passing last_block skips the last newly recorded block. Use last_block + 1 as the end block so the whole recorded range is propagated. --- src/backend/access/heap/hio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/heap/hio.c b/src/backend/access/heap/hio.c index e96e0f77d92..fb4ffb97592 100644 --- a/src/backend/access/heap/hio.c +++ b/src/backend/access/heap/hio.c @@ -401,7 +401,7 @@ RelationAddBlocks(Relation relation, BulkInsertState bistate, { BlockNumber first_fsm_block = first_block + not_in_fsm_pages; - FreeSpaceMapVacuumRange(relation, first_fsm_block, last_block); + FreeSpaceMapVacuumRange(relation, first_fsm_block, last_block + 1); } if (bistate) -- 2.43.7