pgsql: Fix unnecessary padding in incremental backups - Mailing list pgsql-committers

From Tomas Vondra
Subject pgsql: Fix unnecessary padding in incremental backups
Date
Msg-id E1rw4kA-0023SJ-5i@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Tomas Vondra
Date:
Subject: pgsql: Add regression test for BRIN parallel builds
Next
From: Heikki Linnakangas
Date:
Subject: [MASSMAIL]pgsql: Put back initialization of 'sslmode', to silence Coverity