]> 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:27:32 +0000 (17:27 +0900)
committerFujii Masao <fujii@postgresql.org>
Tue, 17 Jan 2017 08:27:32 +0000 (17:27 +0900)
commit974ece58bbb3c0ef185a9d44b1cedae51cd56b04
treef7c14037bc33dd6a6d4c8f27aff9272c40467b32
parentd43a619c60405ecda275ca9e3ac9ead242e20ecb
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