Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.
Date: 2017-11-16 11:17:47
Message-ID: CAD21AoA5ZjXKf+0+sC34k_J=Dd-cR0KBgg6zfcFhKMrCjqxhsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On Thu, Nov 16, 2017 at 1:11 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Thu, Nov 16, 2017 at 10:57 AM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>> Agreed. Attached the updated patch, please review it.

Thank you for the comment.

> + /*
> + * Quick exit if session is not keeping around a non-exclusive backup
> + * already started.
> + */
> + if (sessionBackupState != SESSION_BACKUP_NON_EXCLUSIVE)
> + return;
> I think that it would be more solid to use SESSION_BACKUP_NONE for the
> comparison, and complete the assertion after the quick exit as follows
> as this code path should never be taken for an exclusive backup:

Agreed.

> + Assert(XLogCtl->Insert.nonExclusiveBackups > 0 &&
> + sessionBackupState == SESSION_BACKUP_NON_EXCLUSIVE);
>
> And your patch would discard both SESSION_BACKUP_EXCLUSIVE and
> SESSION_BACKUP_NONE.

Attached the latest patch. Please review it.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
fix_do_pg_abort_backup_v6.patch application/octet-stream 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2017-11-16 11:27:48 Re: [HACKERS] Dynamic result sets from procedures
Previous Message Adrian Escoms 2017-11-16 11:08:35 Re: [HACKERS] Inconsistencies between pg_settings and postgresql.conf