From: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, David Fetter <david(at)fetter(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: is sync rep stalled? |
Date: | 2010-10-05 11:25:07 |
Message-ID: | 1286277907.2025.1138.camel@ebony |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, 2010-10-05 at 18:47 +0900, Fujii Masao wrote:
> On Tue, Oct 5, 2010 at 5:49 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> > On 04.10.2010 17:22, Fujii Masao wrote:
> >>
> >> If we make all the transactions wait until specified standbys have
> >> connected to the master, how do we take a base backup from the
> >> master for those standbys? We seem to be unable to do that because
> >> pg_start_backup also waits forever. Is this right?
> >
> > Hmm, pg_start_backup() writes WAL, but it doesn't commit. Only a commit
> > needs to wait for acknowledgment from the standby, so 'wait forever'
> > behavior doesn't necessarily mean that you can't take a base backup. If you
> > run it outside a transaction you get an implicit commit, though, which will
> > wait, so you might need to do something odd like "begin; select
> > pg_start_backup(); rollback".
>
> Yep. Similarly, we would need to enclose also pg_stop_backup with begin
> and rollback.
Presumably we will have an option to *not* wait forever? So we would be
able to set the option prior to running the base backup? So there isn't
any need to do this rollback trick suggested.
pg_start_backup() and pg_stop_backup() have two use cases:
1) ensuring both are sent through to the standby would make it very easy
to allow backups from the standby.
2) make sure we don't wait, so we can take a base backup at any time
So there's no argument here to prevent it being in a table.
--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Training and Services
From | Date | Subject | |
---|---|---|---|
Next Message | Dimitri Fontaine | 2010-10-05 11:26:39 | Re: standby registration |
Previous Message | Marios Vodas | 2010-10-05 11:21:34 | gist picksplit iteration |