Re: Waiting for archive to complete

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Waiting for archive to complete
Date: 2007-06-26 05:37:01
Message-ID: 1182836221.3625.63.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2007-06-25 at 18:14 -0400, Tom Lane wrote:
> "Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
> > A simple solution is to introduce a new function:
>
> > pg_archive_wait(integer maxwait);
> > maxwait = 0 means wait forever, otherwise time measured in seconds.
>
> maxwait is redundant; people who want a timeout should use
> statement_timeout.

> > This will get the current xlog position and wait for all files prior to
> > that point to be shown as archive done.
>
> Including the current one? If so, it'll wait longer than necessary;
> if not, ISTM it's a gotcha waiting to trap the unwary.
>
> Perhaps better is a variant of pg_stop_backup that includes a wait for
> the pushed-out xlog segment to be archived.

OK, will do.

For a timeout, I think you are suggesting this:

SET statement_timeout = X;
pg_stop_backup_wait();

So no need to include a function parameter for the wait time?
If thats what you are thinking, OK to that also.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2007-06-26 10:40:48 HOT: Incomplete issues
Previous Message Tom Lane 2007-06-26 05:03:59 Re: Winner of naming discussions: Synchronous Commit