Re: detecting binary backup in progress

From: Joe Conway <mail(at)joeconway(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: "Hackers (PostgreSQL)" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: detecting binary backup in progress
Date: 2013-05-31 18:35:34
Message-ID: 51A8ED76.109@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/31/2013 10:42 AM, Andres Freund wrote:
> On 2013-05-31 10:38:56 -0700, Joe Conway wrote:
>> I can check for the presence of $PGDATA/backup_label in order to
>> detect a backup in progress (i.e. pg_start_backup() has been run
>> and pg_stop_backup() has not yet been run).
>>
>> However there is a period of time after pg_start_backup() is
>> first executed to when it completes, during which backup_label
>> file does not exist yet, but the backup has essentially been
>> started. Is there any way to detect this state?
>
> 9.3 has pg_is_in_backup() for that. I don't think there's a way to
> detect it safely without C code before that.

Good to know, although it won't help me much in my current scenario ;-)

Thanks,

Joe

- --
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRqO12AAoJEDfy90M199hlkxgP/jrrnjRKhC+bIHQc/gCmaGXe
CoL490f3ClST2V8e2GffybrqHrJ5xTnhVs04X+kIZOF3vSh67mWmHtSANElxjbYB
t95kkLbkxPhPFnr0ubnalbMRplxlNhLERmi8BWPuknJCJGeEEZ7qlIZROV9GXH51
ZArMewbBlNGUvZQU+DHVYuA3WYVcDSCR0F9AL/O1lLsZ6RVbh/M4WH+q+GzDWsJT
80PDusnSSzHZzq1xMj96kRH3n7s8rpx0kDa5xuM/TBne0Fif1AZuh079cAUtUmnO
w50pgOuTc3lhbH5HmTTuefR94820YBHnol1lsGyLQaKPdXN/6JU+Ssz+q4xx/pWb
Fy1VscYRGb2yka7DpmcGlR4k8kqLhjRwZMKM+GLNGVeERHlHVV30Q++DwVZXQSSF
hfgvpphAv1klCh1R0vwounD/DFb48ZZnVp541GULXSZr1X6cQl+vecrzisDlHjVq
SAJHEvwsiCmR3TzaXgno3GNCmReLfQ9Wg6BJHszSuOieeT2ha+ffJQi7tZZEzsKs
quEYdrgkyXheRwrO+bzi3h59wJf5MdJU3i1U9VPL0JWo9F4QcoGAwrQVYdM3RpUb
DZf2T45V9nNEYYe10FUe3GfpiaoriflOU0RUSlpWoiq2IsCZA+S2jU65mqtdAtOk
JLCDZUJGkoRjXtwWxMqj
=l+5T
-----END PGP SIGNATURE-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2013-05-31 18:41:27 Re: detecting binary backup in progress
Previous Message Bruce Momjian 2013-05-31 18:05:36 Re: removing PD_ALL_VISIBLE