pg.ddx.io pgbackrest/pgbackrest GitHub issues and pull requests
help / color / mirror / Atom feed[pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
10+ messages / 3 participants
[nested] [flat]
* [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-18 17:14 "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
0 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-18 17:14 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
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.patch
diff --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.
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-18 17:15 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
@dwsteele assigned @dwsteele.
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-18 17:15 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
@dwsteele applied label "module [core]".
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-18 17:15 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
@dwsteele applied label "enhancement".
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-18 17:15 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
@dwsteele set milestone to "2.61.0".
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928 (approved): Zero block incremental info for truncated files.
@ 2026-11-19 09:30 ` "pgstef (@pgstef)" <noreply+pgstef@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: pgstef (@pgstef) @ 2026-11-19 09:30 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
The PR looks good to me! 👍
I think I noticed one small issue during the review, though. It's not introduced by this PR, but I thought it might be worth mentioning since we're touching block incremental metadata.
If I understand correctly, the `manifest` command still checks `blockIncrSize != 0` when deciding whether to render block incremental information, rather than checking `blockIncrMapSize != 0`.
This would mean that manifests created by earlier versions, where a file could have a non-zero `blockIncrSize` but no block map, could still cause problems. Without `--filter`, the command would display `map size 0B`, while using `--filter` on such a file would attempt to read the missing `.pgbi` file and fail with a `FileMissingError`.
I think we could simply check `blockIncrMapSize != 0` instead in `cmdManifestFileRender()`, for both JSON and text output. That would also make the rendering consistent with the actual presence of a block map.
It's a pre-existing issue, but I thought it was worth pointing out.
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928 (approved): Zero block incremental info for truncated files.
@ 2026-11-19 14:24 ` "hunleyd (@hunleyd)" <noreply+hunleyd@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: hunleyd (@hunleyd) @ 2026-11-19 14:24 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-19 14:24 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-19 14:24 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
@dwsteele closed this.
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-19 14:24 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-19 14:24 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
@dwsteele merged this (commit 5d0dc8c89dd0).
^ permalink raw [nested|flat] 10+ messages in thread
* Re: [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files.
@ 2026-11-19 14:26 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
8 siblings, 0 replies; 10+ messages in thread
From: dwsteele (@dwsteele) @ 2026-11-19 14:26 UTC (permalink / raw)
To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>
> If I understand correctly, the manifest command still checks blockIncrSize != 0 when deciding whether to render block incremental information, rather than checking blockIncrMapSize != 0.
@pgstef Good point, done in 17fd7c4c45e.
^ permalink raw [nested|flat] 10+ messages in thread
end of thread, other threads:[~2026-11-19 14:26 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 17:14 [pgbackrest/pgbackrest] PR #2928: Zero block incremental info for truncated files. "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-18 17:15 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-19 09:30 ` Re: [pgbackrest/pgbackrest] PR #2928 (approved): Zero block incremental info for truncated files. "pgstef (@pgstef)" <noreply+pgstef@github.com>
2026-11-19 14:24 ` Re: [pgbackrest/pgbackrest] PR #2928 (approved): Zero block incremental info for truncated files. "hunleyd (@hunleyd)" <noreply+hunleyd@github.com>
2026-11-19 14:24 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-19 14:24 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-19 14:26 ` "dwsteele (@dwsteele)" <noreply+dwsteele@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