pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix incremental backup interaction with XLOG_DBASE_CREATE_FILE_C
Date: Mon, 04 Mar 2024 18:33:48 +0000
Message-ID: <E1rhD8F-0024OH-Se@gemulon.postgresql.org> (raw)

Fix incremental backup interaction with XLOG_DBASE_CREATE_FILE_COPY.

After XLOG_DBASE_CREATE_FILE_COPY, a correct incremental backup needs
to copy in full everything with the database and tablespace OID
mentioned in that record; but that record doesn't specifically mention
the blocks, or even the relfilenumbers, of the affected relations.
As a result, we were failing to copy data that we should have copied.

To fix, enter the DB OID and tablespace OID into the block reference
table with relfilenumber 0 and limit block 0; and treat that as a
limit block of 0 for every relfilenumber whose DB OID and tablespace
OID match.

Also, add a test case.

Patch by me, reviewed by Noah Misch.

Discussion: http://postgr.es/m/CA+Tgmob0xa=ByvGLMdAgkUZyVQE=r4nyYZ_VEa40FCfEDFnTKA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d75c4027b6f260f2045b162017567aeeb909b056

Modified Files
--------------
src/backend/backup/basebackup_incremental.c    | 18 ++++++-
src/backend/postmaster/walsummarizer.c         | 75 ++++++++++++++++++++++++++
src/bin/pg_combinebackup/meson.build           |  1 +
src/bin/pg_combinebackup/t/006_db_file_copy.pl | 58 ++++++++++++++++++++
4 files changed, 151 insertions(+), 1 deletion(-)



view thread (2+ messages)

Message-ID: <E1rhD8F-0024OH-Se@gemulon.postgresql.org>
Permalink:  ../E1rhD8F-0024OH-Se@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rhD8F-0024OH-Se@gemulon.postgresql.org

 · 

reply

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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix incremental backup interaction with XLOG_DBASE_CREATE_FILE_C
  In-Reply-To: <E1rhD8F-0024OH-Se@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