pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14326: Unexpected status after crash during exclusive backup
Date: Wed, 21 Sep 2016 11:42:27 +0200
Message-ID: <9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it> (raw)
In-Reply-To: <CAB7nPqT7grAX+7aJLd4Z-3f-haOV1f2A6ZCnK9v-6i=kFPe9qQ@mail.gmail.com>
References: <20160916095448.1421.65742@wrigleys.postgresql.org>
	<CAB7nPqT7grAX+7aJLd4Z-3f-haOV1f2A6ZCnK9v-6i=kFPe9qQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 21/09/16 08:50, Michael Paquier wrote:
> On Fri, Sep 16, 2016 at 6:54 PM,  <marco.nenciarini@2ndquadrant.it> wrote:
>> The workaround I found to reset this state is to force the instance through
>> another backup recovery, by starting an exclusive backup, saving the
>> backup_label, stopping the backup and restarting the instance with the saved
>> backup_label in place.
> 
> That's not user-friendly.
> 

I agree, it isn't. But it's the only way to reset that state with the
current available tools. Probably, the pg_resetxlog tool could be
modified to allow the user to reset that value only.


>> I don't know the best way to handle this situation, but at least, I'd like a
>> warning message when the instance exits from the crash recovery while
>> backupStartPoint is still set.
> 
> So you would get such a warning even when you restore from a backup
> willingly, no? That may confuse users. Now, the case you are referring
> to is unfortunately a known problem with exclusive backups... There is
> no way to make the difference between a node restored from a backup
> and a node that crashed while a backup is taken.
> And that may be a
> reason to make non-exclusive backups more popular because they are
> more reliable.

You are right, an eventual solution to this issue must not interfere
with normal recovery from a backup.

To mitigate the effect we could to reset the state of the
backupStartPoint field during the pg_start_backup invocation. So, if a
backup will be interrupted by a reboot, the instance state will be
cleaned during the next backup.

Another possibility could be to emit a warning (and maybe reset
backupStartPoint value) during the shutdown of an instance that is fully
"in production".

Regards,
Marco

-- 
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.nenciarini@2ndQuadrant.it | www.2ndQuadrant.it

Attachments:

  signature.asc (application/pgp-signature, 800B) download

view thread (3+ messages)

Message-ID: <9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it>
Permalink:  ../9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it/
Also on:    postgresql.org/message-id/9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it

 · 

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: marco.nenciarini@2ndquadrant.it, michael.paquier@gmail.com
  Subject: Re: BUG #14326: Unexpected status after crash during exclusive backup
  In-Reply-To: <9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it>
  References: <20160916095448.1421.65742@wrigleys.postgresql.org> <CAB7nPqT7grAX+7aJLd4Z-3f-haOV1f2A6ZCnK9v-6i=kFPe9qQ@mail.gmail.com> <9631d538-cab9-ad0a-1852-9b6fb6d40065@2ndquadrant.it>

* 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