1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-06 08:49:29 +02:00

Ensure no continuations when block size equals super block size.

In this case each super block contains a single block so continuations are not possible.
This commit is contained in:
David Steele
2023-03-12 16:21:43 +07:00
parent d7704a8bc8
commit 1281a6eaf8
2 changed files with 5 additions and 0 deletions

View File

@@ -52,6 +52,7 @@
<commit subject="Exclude backup set size from info for block incremental backups."/>
<commit subject="Rename BlockHash to BlockChecksum."/>
<commit subject="Update default block size and super block values based on testing."/>
<commit subject="Ensure no continuations when block size equals super block size."/>
<release-item-contributor-list>
<release-item-contributor id="david.steele"/>

View File

@@ -137,6 +137,8 @@ blockMapNewRead(IoRead *const map, size_t checksumSize)
// If the reference is continued use the prior offset and size values
if (referenceEncoded & BLOCK_MAP_FLAG_CONTINUE)
{
ASSERT(!blockEqual);
blockMapItem.offset = referenceData->offset;
blockMapItem.size = referenceData->size;
referenceContinue = true;
@@ -333,6 +335,8 @@ blockMapWrite(const BlockMap *const this, IoWrite *const output, const bool bloc
// the last one for the reference.
if (reference->offset == referenceData->offset)
{
ASSERT(!blockEqual);
referenceEncoded |= BLOCK_MAP_FLAG_CONTINUE;
referenceContinue = true;
}