agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Clear base backup progress on backup failure
Date: Wed, 01 Jul 2026 14:08:12 +0000
Message-ID: <E1wevbo-000vK5-0u@gemulon.postgresql.org> (raw)
Clear base backup progress on backup failure
Previously, if a base backup failed after it had started streaming
files, pg_stat_progress_basebackup could continue to show a stale
progress entry even though the backup was no longer running. This could
be observed when the client kept the replication connection open after
the error. It is normally not observable when using pg_basebackup,
because the client disconnects after the error.
The problem was that progress reporting was cleared only after
successful completion.
This commit moves the progress reporting cleanup into the progress
sink's cleanup callback so that it is cleared after both successful
and failed backups.
Backpatch to v15. v14 has the same issue, but the fix does not apply
cleanly because it lacks the base backup sink infrastructure. Since
the bug does not affect the backup itself and is normally not
observable when using pg_basebackup, skip the v14 backpatch.
Author: Chao Li <lic@highgo.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/EA1A6CD2-EFA6-462B-9A02-03003555AB4A@gmail.com
Backpatch-through: 15
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/e2ea6bfed8803cd8d11b5cd85f9669a57d517735
Modified Files
--------------
src/backend/backup/basebackup.c | 2 --
src/backend/backup/basebackup_progress.c | 22 ++++++++++++----------
src/include/backup/basebackup_sink.h | 1 -
3 files changed, 12 insertions(+), 13 deletions(-)
view thread (6+ messages) latest in thread
Message-ID: <E1wevbo-000vK5-0u@gemulon.postgresql.org>
Permalink: ../E1wevbo-000vK5-0u@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wevbo-000vK5-0u@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: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Clear base backup progress on backup failure
In-Reply-To: <E1wevbo-000vK5-0u@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox