Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit55a5ee3

Browse files
committed
Fix incorrect calculation in BlockRefTableEntryGetBlocks.
The previous formula was incorrect in the case where the function'snblocks argument was a multiple of BLOCKS_PER_CHUNK, which happenswhenever a relation segment file is exactly 512MB or exactly 1GB inlength. In such cases, the formula would calculate a stop_offset of0 rather than 65536, resulting in modified blocks in the second halfof a 1GB file, or all the modified blocks in a 512MB file, beingomitted from the incremental backup.Reported off-list by Tomas Vondra and Jakub Wartak.Discussion:http://postgr.es/m/CA+TgmoYwy_KHp1-5GYNmVa=zdeJWhNH1T0SBmEuvqQNJEHj1Lw@mail.gmail.com
1 parent079d94a commit55a5ee3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/common/blkreftable.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,11 @@ BlockRefTableEntryGetBlocks(BlockRefTableEntry *entry,
410410
if (chunkno==start_chunkno)
411411
start_offset=start_blkno %BLOCKS_PER_CHUNK;
412412
if (chunkno==stop_chunkno-1)
413-
stop_offset=stop_blkno %BLOCKS_PER_CHUNK;
413+
{
414+
Assert(stop_blkno>chunkno*BLOCKS_PER_CHUNK);
415+
stop_offset=stop_blkno- (chunkno*BLOCKS_PER_CHUNK);
416+
Assert(stop_offset <=BLOCKS_PER_CHUNK);
417+
}
414418

415419
/*
416420
* Handling differs depending on whether this is an array of offsets

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp