postgresql/src
Fujii Masao 9fa00e312b Prevent BASE_BACKUP in the middle of another backup in the same session.
Multiple non-exclusive backups are able to be run conrrently in different
sessions. But, in the same session, only one non-exclusive backup can be
run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)
is called in the middle of another non-exclusive backup in the same session,
an error is thrown.

However, previously, in logical replication walsender mode, even if that
walsender session had already called pg_backup_start and started
a non-exclusive backup, it could execute BASE_BACKUP command and
start another non-exclusive backup. Which caused subsequent pg_backup_stop
to throw an error because BASE_BACKUP unexpectedly reset the session state
marked by pg_backup_start.

This commit prevents BASE_BACKUP command in the middle of another
non-exclusive backup in the same session.

Back-patch to all supported branches.

Author: Fujii Masao
Reviewed-by: Kyotaro Horiguchi, Masahiko Sawada, Michael Paquier, Robert Haas
Discussion: https://postgr.es/m/3374718f-9fbf-a950-6d66-d973e027f44c@oss.nttdata.com
2022-07-20 09:52:29 +09:00
..
backend Prevent BASE_BACKUP in the middle of another backup in the same session. 2022-07-20 09:52:29 +09:00
bin Fix \watch's interaction with libedit on ^C. 2022-07-10 16:54:09 +12:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:50:07 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Re-add SPICleanup for ABI compatibility in stable branch 2022-07-18 19:33:46 +02:00
interfaces Fix previous commit's ecpg_clocale for ppc Darwin. 2022-07-02 21:03:23 -07:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
pl Fix SPI's handling of errors during transaction commit. 2022-06-22 12:12:00 -04:00
port Stamp 12.11. 2022-05-09 17:18:31 -04:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:35 -05:00
test Fix alias matching in transformLockingClause(). 2022-07-07 13:07:57 +01:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:55:17 -04:00
tools Improve setup of environment values for commands in MSVC's vcregress.pl 2022-05-11 10:22:37 +09:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Fix prove_installcheck to use correct paths when used with PGXS 2021-07-01 08:47:04 -04:00
Makefile.shlib Fix pkg-config files for static linking 2021-09-06 09:43:18 +02:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:05:50 +02:00