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.incindex 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.cindex 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.