pgsql: Fix an assertion failure related to an exclusive backup.

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix an assertion failure related to an exclusive backup.
Date: 2017-01-17 08:40:46
Message-ID: E1cTPJu-0008Cy-Lk@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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(dot)fsf(at)credativ(dot)de>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/974ece58bbb3c0ef185a9d44b1cedae51cd56b04

Modified Files
--------------
src/backend/access/transam/xlog.c | 223 +++++++++++++++++++++++++-------------
1 file changed, 150 insertions(+), 73 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2017-01-17 11:11:59 pgsql: Add compression support to pg_receivexlog
Previous Message Tom Lane 2017-01-16 22:48:42 Re: [COMMITTERS] pgsql: Permit dump/reload of not-too-large >1GB tuples

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-01-17 09:36:42 Re: pageinspect: Hash index support
Previous Message Mithun Cy 2017-01-17 07:52:13 Re: pageinspect: Hash index support