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


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

Reply via email to