pg.ddx.io  pgbackrest/pgbackrest GitHub issues and pull requests  
help / color / mirror / Atom feed
From: dwsteele (@dwsteele) <noreply+dwsteele@github.com>
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
Subject: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
Date: Wed, 18 Nov 2026 17:14:57 +0000
Message-ID: <gh-pgbackrest-pgbackrest-2928@github.com> (raw)

A block incremental file truncated to zero during the backup was stored without a map but kept the block incremental size and checksum size in the manifest. Zero these values for truncated files.

Check in the backup test validation that no file has a block incremental size without a map.

These values were not an issue but could cause confusion and definitely use space in the manifest. Best to be tidy.

inline patch 1: src/command/backup/process.c.inc, test/src/module/command/backupTest.c (+8/-0 lines) download inline-1.patchdiff --git a/src/command/backup/process.c.inc b/src/command/backup/process.c.inc index 4a2359f594..004324f3c7 100644 --- a/src/command/backup/process.c.inc +++ b/src/command/backup/process.c.inc @@ -304,6 +304,10 @@ backupJobResult( file.bundleOffset = bundleOffset; file.blockIncrMapSize = blockIncrMapSize; + // Zero block incremental values for a truncated file + if (copyResult == backupCopyResultTruncate) + file.blockIncrSize = file.blockIncrChecksumSize = 0; + manifestFileUpdate(manifest, &file); } } diff --git a/test/src/module/command/backupTest.c b/test/src/module/command/backupTest.c index 8e05e08697..3f9845b82e 100644 --- a/test/src/module/command/backupTest.c +++ b/test/src/module/command/backupTest.c @@ -484,6 +484,10 @@ testBackupValidate(const Storage *const storage, const String *const path, const ManifestFilePack **const filePack = lstGet(manifest->pub.fileList, fileIdx); ManifestFile file = manifestFileUnpack(manifest, *filePack); + // Block incremental size without a map + if (file.blockIncrSize != 0 && file.blockIncrMapSize == 0) + THROW_FMT(AssertError, "'%s' has block incremental size but no map", strZ(file.name)); + // If compressed or block incremental then set the repo-size to size so it will not be in test output. Even the same // compression algorithm can give slightly different results based on the version so repo-size is not deterministic for // compression. Block incremental maps increase repo-size in a non-obvious way.

view thread (10+ messages)  latest in thread

Message-ID: <gh-pgbackrest-pgbackrest-2928@github.com>
Permalink:  ../gh-pgbackrest-pgbackrest-2928@github.com/

 ·  · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox