pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Michael Paquier <michael.paquier@gmail.com>
To: Anastasia Lubennikova <lubennikovaav@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: Backend crash on non-exclusive backup cancel
Date: Wed, 15 Mar 2017 11:41:40 -0400
Message-ID: <72ad0edb-766f-b70b-8ca7-a3af3d52c8eb@pgmasters.net> (raw)
In-Reply-To: <CAB7nPqQD9X0Bbzqy4YyUT_xrxEseaHBJ6mghiA4VvJFVJCZ-5Q@mail.gmail.com>
References: <c86627c3-fcdd-9b67-5a03-e2f1113d1b14@pgmasters.net>
	<CAB7nPqR9xvq_wYKFjUYF1CECFLRbe6xGhGWaCv_yE8pZU71Ztw@mail.gmail.com>
	<20170314152714.22419.22145.pgcf@coridan.postgresql.org>
	<CAB7nPqQD9X0Bbzqy4YyUT_xrxEseaHBJ6mghiA4VvJFVJCZ-5Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 3/15/17 2:28 AM, Michael Paquier wrote:
> On Wed, Mar 15, 2017 at 12:27 AM, Anastasia Lubennikova
> <lubennikovaav@gmail.com> wrote:
>> As far as I understand, in this thread were discussed two bugs of pg_stop_backup().
>> Thanks to the clear descriptions above, I easily reproduced both of them.
>>
>> BUG#1:
>> Server crashes on assertion on call of pg_stop_backup(false) after interrupted call of pg_stop_backup(false).
>> TRAP: FailedAssertion("!(XLogCtl->Insert.nonExclusiveBackups > 0)", File: "xlog.c", Line: 10747)
>>
>> BUG#2:
>> Failure to start an exclusive backup with the same name, if previous exclusive backup was stopped in another session.
>>
>> Both problems seem to be fixed with patch "backup-session-locks-fixes.patch".
>> Speaking of the patch itself, I have a question: shouldn't we also update sessionBackupState
>> in pg_stop_backup_callback() along with XLogCtl->Insert.exclusiveBackupState?
> 
> No, that's not necessary. sessionBackupState is not changed until the
> code path where pg_stop_backup_callback() is active, and remains
> unchanged until it gets deactivated.
> 
>> And couple of minor notes:
>> 1) + * Routines to starting stop, and get status of a base backup
>> Probably should be: + * Routines to start, stop and get status of a base backup
>> And also this comment should be moved below the enum.
>>
>> 2) This is used in parallel of the shared memory status
>> s/ in parallel of/ in parallel with
> 
> Agreed on both points.

I have tested this patch and it behaves as expected and fixes the
original issue I reported.  One nit, I think:

+	 * SESSION_BACKUP_EXCLUSIVE in this one. Actual verification that an

Would be better phrased as:

+	 * SESSION_BACKUP_EXCLUSIVE in this function. Actual verification that an

Thanks,
-- 
-David
david@pgmasters.net


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (15+ messages)  latest in thread

Message-ID: <72ad0edb-766f-b70b-8ca7-a3af3d52c8eb@pgmasters.net>
Permalink:  ../72ad0edb-766f-b70b-8ca7-a3af3d52c8eb@pgmasters.net/
Also on:    postgresql.org/message-id/72ad0edb-766f-b70b-8ca7-a3af3d52c8eb@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david@pgmasters.net, michael.paquier@gmail.com, lubennikovaav@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Backend crash on non-exclusive backup cancel
  In-Reply-To: <72ad0edb-766f-b70b-8ca7-a3af3d52c8eb@pgmasters.net>
  References: <c86627c3-fcdd-9b67-5a03-e2f1113d1b14@pgmasters.net> <CAB7nPqR9xvq_wYKFjUYF1CECFLRbe6xGhGWaCv_yE8pZU71Ztw@mail.gmail.com> <20170314152714.22419.22145.pgcf@coridan.postgresql.org> <CAB7nPqQD9X0Bbzqy4YyUT_xrxEseaHBJ6mghiA4VvJFVJCZ-5Q@mail.gmail.com> <72ad0edb-766f-b70b-8ca7-a3af3d52c8eb@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox