Re: detecting binary backup in progress

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: detecting binary backup in progress
Date: 2013-06-01 18:11:06
Message-ID: CA+U5nMLSJA4MsWiGJvW7Y5Ypth02wEu_GN4F=fYoNeYQbeSfuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1 June 2013 15:45, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
>> The way to resolve this is to have two functions:
>> pg_is_in_backup() - which covers both/all kinds of backup
>> pg_is_in_exclusive_backup() - which covers just the exclusive backup mode
>
> What will you do with pg_backup_start_time()?

Hmm, at least all of those functions use the "backup" name
consistently. I guess I wasn't suggesting we rename pg_start_backup()
to pg_start_exclusive_backup(), so maybe it makes sense.

pg_start_backup() talks about an online backup, while
pg_is_in_backup() talks about an exclusive backup. Minimum change here
would be to make pg_start_backup talk about an exclusive backup also.

What we need is a function that says whether it is possible to
shutdown because of a backup, or not. pg_basebackup is an active task,
whereas an exclusive backup never is. So we need a function to tell us
that although nothing else is running, but we are running an exclusive
backup. So changing pg_is_in_backup() to refer to all kinds of backup
still allows it to be used for its primary purpose - to tell whether
its OK to shutdown or not, but it also makes it clearer.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-06-01 18:25:16 Re: Combo xids
Previous Message Simon Riggs 2013-06-01 17:56:34 Re: getting rid of freezing