Re: pg_export_snapshot on standby side

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_export_snapshot on standby side
Date: 2014-08-06 17:17:55
Message-ID: 20140806171755.GQ13302@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Seems we still have not addressed this.

---------------------------------------------------------------------------

On Sat, May 25, 2013 at 10:18:57AM +0100, Simon Riggs wrote:
> On 21 May 2013 19:16, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> > We cannot run parallel pg_dump on the standby server because
> > pg_export_snapshot() always fails on the standby. Is this the oversight
> > of parallel pg_dump or pg_export_snapshot()?
> >
> > pg_export_snapshot() fails in the standby because it always assigns
> > new XID and which is not allowed in the standby. Do we really need
> > to assign new XID even in the standby for the exportable snapshot?
>
> Having looked at the code, I say No, we don't *need* to.
>
> There are various parts of the code that deal with
> takenDuringRecovery, so much of this was clearly intended to work in
> recovery.
>
> We use the topXid for the name of the snapshot file. That is clearly
> unnecessary and we should be using the virtualxid instead like we do
> elsewhere. We also use the topXid to test whether it is still running,
> though again, we could equally use the virtualxid instead. There is no
> problem with virtualxids possibly not being active anymore, since if
> we didn't have an xid before and don't have one now, and the xmin is
> the same, the snapshot is still valid.
>
> I think we should treat this as a bug and fix it in 9.3 while we're
> still in beta. Why? Because once we begin using the topXid as the
> filename we can't then change later to using the vxid.
>
> --
> Simon Riggs http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2014-08-06 17:37:17 Re: Supporting Windows SChannel as OpenSSL replacement
Previous Message Claudio Freire 2014-08-06 17:08:50 Re: Minmax indexes