Re: Better support of exported snapshots with pg_dump - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Better support of exported snapshots with pg_dump
Date
Msg-id 20141015050633.GB7242@alap3.anarazel.de
Whole thread Raw
In response to Re: Better support of exported snapshots with pg_dump  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Better support of exported snapshots with pg_dump
Re: Better support of exported snapshots with pg_dump
List pgsql-hackers
On 2014-10-15 07:09:10 +0900, Michael Paquier wrote:
> > whatever replication solution you use and just have pg_dump accept the
> > snapshot as input parameter? I am not sure how much I like pg_dump creating
> > the slot. I am aware that you need to have the replication connection open
> > but that's IMHO just matter of scripting it together.
> The whole point of the operation is to reduce the amount of time the
> external snapshot is taken to reduce the risk of race conditions that
> may be induced by schema changes. See for example discussions related
> to why we do not authorize specifying a snapshot name as an option of
> pg_dump.

I think that's completely the wrong way to go at this. The time it takes
to create a replication slot under write load is far larger than the
time it takes to start pg_dump and load. This really doesn't add any
actual safety. Also, the inability to use the snapshot outside of
pg_dump restricts the feature far too much imo.

I personally think we should just disregard the race here and add a
snapshot parameter. The race is already there and not exactly
small. Let's not kid ourselves that hiding it solves anything.

But if that's not the way to go, we need to think about a way of how to
prevent "problematic" DDL that's not racy.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: narwhal and PGDLLIMPORT
Next
From: Stephen Frost
Date:
Subject: Additional role attributes && superuser review