pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Dimitri Maziuk <dmaziuk@bmrb.wisc.edu>
To: pgsql-general@lists.postgresql.org
Subject: Re: logical replication snapshots
Date: Fri, 27 Jul 2018 15:20:37 -0700
Message-ID: <dc8f9538-81b8-9193-ceab-481a0eb4b4f0@aklaver.com> (raw)
In-Reply-To: <5c10ced3-7e1a-d673-1da9-d45985bf37f5@bmrb.wisc.edu>
References: <20180724172115.ztthbxmfgucnuuq3@alvherre.pgsql>
	<20180724184337.k6nq7k3cq7xoorjn@alap3.anarazel.de>
	<04dcfd2d-6201-09e7-4209-9894d669f694@bmrb.wisc.edu>
	<20180725152827.g22qmue3wgycifjh@alap3.anarazel.de>
	<9b9a72f4-44c8-5e78-8814-fdc39ca3a3ad@bmrb.wisc.edu>
	<cade60b5-cdc5-a9ed-68b8-173f394a9ce5@aklaver.com>
	<a1b9701e-5249-2a61-6a37-f8f02c3fe707@bmrb.wisc.edu>
	<1c539619-7b72-3669-81cd-2a55352b1008@aklaver.com>
	<20180726005706.gzinfqg7mjfnsf6g@alap3.anarazel.de>
	<c04c0920-4085-8647-dc03-aae453bb2aa9@bmrb.wisc.edu>
	<10933bb0-5a3b-4ed2-fc6c-2a712510ef9b@aklaver.com>
	<00acc822-e5d6-b9ad-43a9-e989d8581ae7@bmrb.wisc.edu>
	<40f0b879-2b5b-05ad-57ba-3688510be87d@aklaver.com>
	<fbe173fd-7780-a691-5ec5-f5173c5e5c57@bmrb.wisc.edu>
	<93e99c67-cdc5-e776-2a00-3ba090e2c4c4@aklaver.com>
	<1542cf6a-151d-24b6-afc2-b4cee0ae1aa1@bmrb.wisc.edu>
	<bf2947f7-9528-2f42-7130-b84bcfa9b249@aklaver.com>
	<5c10ced3-7e1a-d673-1da9-d45985bf37f5@bmrb.wisc.edu>

On 07/27/2018 03:04 PM, Dimitri Maziuk wrote:
> On 07/26/2018 07:11 PM, Adrian Klaver wrote:
>> On 07/26/2018 04:48 PM, Dimitri Maziuk wrote:
> ...
>>> The publication foopub is at this point fubar I take it? And needs to be
>>> re-created on the publisher and reconnected on the subscriber? Complete
>>> with with inital resync?
>>
>> Not sure. Personally I would try:
>>
>> 1) ALTER PUBLICATION DROP TABLE foo|bar;
>>
>> 2) ALTER PUBLICATION ADD TABLE foo|bar;
>>
>> 3) ALTER SUBSCRIPTION sub_name REFRESH PUBLICATION
>>
>> If you get to 3) it will re-sync the data unless you tell it otherwise.
>>
>> The above is probably dependent on the size of the publication. If you
>> did a publication for ALL it would make more sense to do the above then
>> if you did a publication for just foo or bar.
> 
> ... but if I did the publication for ALL, I could just use streaming
> replication and then drop table/add table would replicate automagically ...

Well I was just showing the extremes from a single table publication to 
ALL tables. You can also do subsets of ALL. Remember that binary 
replication(streaming) involves the whole Postgres cluster, e.g. all the 
databases in the cluster no choice in the matter. Also it does not allow 
you to shape what is replicated. In other words what form of DML you 
want replicated e.g. UPDATE, INSERT, DELETE. Last but not least logical 
replication works across major versions and different OS'es, which 
binary replication does not.

> 
> It looks like we probably have to re-think a few of our workflows and
> procedures, and until/unless that happens, logical replication won't do
> what we want. Which means figuring out this 13-million-files problem
> becomes a very low priority for me. Unfortunately: it'd be nice to track
> it down and squash it...


> 
> Thanks everyone,
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (27+ messages)  latest in thread

Message-ID: <dc8f9538-81b8-9193-ceab-481a0eb4b4f0@aklaver.com>
Permalink:  ../dc8f9538-81b8-9193-ceab-481a0eb4b4f0@aklaver.com/
Also on:    postgresql.org/message-id/dc8f9538-81b8-9193-ceab-481a0eb4b4f0@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, dmaziuk@bmrb.wisc.edu
  Subject: Re: logical replication snapshots
  In-Reply-To: <dc8f9538-81b8-9193-ceab-481a0eb4b4f0@aklaver.com>
  References: <20180724172115.ztthbxmfgucnuuq3@alvherre.pgsql> <20180724184337.k6nq7k3cq7xoorjn@alap3.anarazel.de> <04dcfd2d-6201-09e7-4209-9894d669f694@bmrb.wisc.edu> <20180725152827.g22qmue3wgycifjh@alap3.anarazel.de> <9b9a72f4-44c8-5e78-8814-fdc39ca3a3ad@bmrb.wisc.edu> <cade60b5-cdc5-a9ed-68b8-173f394a9ce5@aklaver.com> <a1b9701e-5249-2a61-6a37-f8f02c3fe707@bmrb.wisc.edu> <1c539619-7b72-3669-81cd-2a55352b1008@aklaver.com> <20180726005706.gzinfqg7mjfnsf6g@alap3.anarazel.de> <c04c0920-4085-8647-dc03-aae453bb2aa9@bmrb.wisc.edu> <10933bb0-5a3b-4ed2-fc6c-2a712510ef9b@aklaver.com> <00acc822-e5d6-b9ad-43a9-e989d8581ae7@bmrb.wisc.edu> <40f0b879-2b5b-05ad-57ba-3688510be87d@aklaver.com> <fbe173fd-7780-a691-5ec5-f5173c5e5c57@bmrb.wisc.edu> <93e99c67-cdc5-e776-2a00-3ba090e2c4c4@aklaver.com> <1542cf6a-151d-24b6-afc2-b4cee0ae1aa1@bmrb.wisc.edu> <bf2947f7-9528-2f42-7130-b84bcfa9b249@aklaver.com> <5c10ced3-7e1a-d673-1da9-d45985bf37f5@bmrb.wisc.edu> <dc8f9538-81b8-9193-ceab-481a0eb4b4f0@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox