]> granicus.if.org Git - postgresql/commit
Fix an assertion failure related to an exclusive backup.
authorFujii Masao <fujii@postgresql.org>
Tue, 17 Jan 2017 08:31:51 +0000 (17:31 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 17 Jan 2017 08:31:51 +0000 (17:31 +0900)
commit9e7f00d861fffacaec49473f89513ee8abca076c
treecc250a37c2e274f32df1b9e6e3ba928c30611c69
parentc3775577878fc89b7b5ccb3f222cd8a01425ccb6
Fix an assertion failure related to an exclusive backup.

Previously multiple sessions could execute pg_start_backup() and
pg_stop_backup() to start and stop an exclusive backup at the same time.
This could trigger the assertion failure of
"FailedAssertion("!(XLogCtl->Insert.exclusiveBackup)".
This happend because, even while pg_start_backup() was starting
an exclusive backup, other session could run pg_stop_backup()
concurrently and mark the backup as not-in-progress unconditionally.

This patch introduces ExclusiveBackupState indicating the state of
an exclusive backup. This state is used to ensure that there is only
one session running pg_start_backup() or pg_stop_backup() at
the same time, to avoid the assertion failure.

Back-patch to all supported versions.

Author: Michael Paquier
Reviewed-By: Kyotaro Horiguchi and me
Reported-By: Andreas Seltenreich
Discussion: <87mvktojme.fsf@credativ.de>
src/backend/access/transam/xlog.c