Re: detecting binary backup in progress

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: detecting binary backup in progress
Дата
Msg-id 20130601153139.GC6732@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: detecting binary backup in progress  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
On 2013-06-01 08:27:42 -0700, Joe Conway wrote:
> > Uh. Why would you do the lock(file) thingy *after* calling 
> > pg_start_backup? You should do lock before calling start backup
> > and remove the lock after calling stop backup. In that case I don't
> > see where the race condition is?
> 
> No, the point is I have no control over Proc1. I am trying to prevent
> Proc2 from running concurrently with a binary backup (Proc1). So I
> need to lock out Proc1, or detect it is running and wait for it to finish.

Backups over which you don't have control sound a bit scary ;). I think
at that point you have a race condition no matter what since the backup
could be started between your check and when you call pg_start_backup
anyay. So just calling pg_start_backup and handling the error properly
sounds like the way to go in that case.

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: detecting binary backup in progress
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pg_dump with postgis extension dumps rules separately