Re: Waiting for archive to complete - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Waiting for archive to complete
Date
Msg-id 7081.1182809648@sss.pgh.pa.us
Whole thread Raw
In response to Waiting for archive to complete  ("Simon Riggs" <simon@2ndquadrant.com>)
Responses Re: Waiting for archive to complete  ("Simon Riggs" <simon@2ndquadrant.com>)
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Chuck McDevitt"
Date:
Subject: libpq protocol version 2
Next
From: Tom Lane
Date:
Subject: Re: libpq protocol version 2