From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix unnecessary padding in incremental backups
Date: Sun, 14 Apr 2024 18:38:22 +0000
Message-ID: <E1rw4kA-0023SJ-5i@gemulon.postgresql.org> (raw)
Fix unnecessary padding in incremental backups
Commit 10e3226ba13d added padding to incremental backups to ensure the
block data is properly aligned. The code in sendFile() however failed to
consider that the header may be a multiple of BLCKSZ and thus already
aligned, adding a full BLCKSZ of unnecessary padding.
Not only does this make the incremental file a bit larger, but the other
places calculating the amount of padding did realize it's not needed and
did not include it in the formula. This resulted in pg_basebackup
getting confused while parsing the data stream, trying to access files
with invalid filenames (e.g. with binary data etc.) and failing.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/cd4b6af620975bb9802c464a06d2289d2f97cbf4
Modified Files
--------------
src/backend/backup/basebackup.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix unnecessary padding in incremental backups
In-Reply-To: <E1rw4kA-0023SJ-5i@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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