pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Olivier Gautherot <olivier@gautherot.net>
Cc: pgsql-general@postgresql.org
Subject: Re: Fast logical replication jump start with PG 10
Date: Fri, 25 May 2018 21:11:44 -0700
Message-ID: <239dddd5-aa45-a7fe-b35a-085b978f8bd6@aklaver.com> (raw)
In-Reply-To: <CAJ7S9TWdYCi-FBhB4a5=gf7TfdZ=z6B+4wAQLAEJzZtoa0V3LA@mail.gmail.com>
References: <CAJ7S9TVygExihaXt2E1bNH_0kGnx8bA62fmGreDGWTwb3_Pi7g@mail.gmail.com>
	<729c1726-2e61-f03f-fe7e-c1dcf3f59e85@aklaver.com>
	<CAJ7S9TWdYCi-FBhB4a5=gf7TfdZ=z6B+4wAQLAEJzZtoa0V3LA@mail.gmail.com>

On 05/25/2018 06:35 PM, Olivier Gautherot wrote:
> Hi Adrian, thanks for your reply. Here is the clarification.
> 
> 1) It is indeed a pg_upgrade from 9.2 to 10.4. Depending on the test 
> machine, it runs in between 15 and 20 minutes for just over 100GB. I can 
> negotiate this time with our customer. The vacuum process took another 5 
> to 7 minutes. This this what I was referring to with the 30 minutes 
> (point 3 in your questions)
> 
> 2) After pg_upgrade, I published the tables on the database (in the 
> sense "CREATE DATABASE") and subscribed to this publication on the 
> second server (logical replication). The data copy processed started 
> immediately and took around 1 hour. I then loaded the indexes, what took > another 2h20m. At that point the active-passive cluster was ready to go.

The index creation was done on the replicated machine I presume, using 
what command?

> Note that the active and the passive databases are on different machines.
> 
> 4) By "database" I mean the result of "CREATE DATABASE" and we have 1 
> per server (or "cluster" in your terminology - I tend to use this word 
> for a group of machines). We are currently using a streaming replication 

Yeah I understand, it is just that database and cluster have specific 
meanings in Postgres and it helps to stick to those meanings when 
discussing replication operations. Lowers the confusion level:)

> between the 9.2 servers, so it could be a fall-back option after the 
> upgrade (I wanted to remove part of the indexes on the master to lower 
> the load, reason to use the logical replication... if the execution time 
> is not too excessive).

So the time you showed was with those indexes removed or not?

> 
> Hope it clarifies the question
> Best regards
> Olivier
> 
> 
> Olivier Gautherot
> olivier@gautherot.net <mailto:olivier@gautherot.net>
> Cel:+56 98 730 9361
> Skype: ogautherot
> www.gautherot.net <http://www.gautherot.net;
> http://www.linkedin.com/in/ogautherot
> 
> On Fri, May 25, 2018 at 7:51 PM, Adrian Klaver 
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
> 
>     On 05/25/2018 02:12 PM, Olivier Gautherot wrote:
> 
>         Hi,
> 
>         I just sent the question on StackOverflow but realized that this
>         audience may be more savvy. So sorry in advance for cross-posting...
> 
>         I'm in the process of upgrading a PG from 9.2 to 10.4.
>         pg_upgrade worked fine on the master and was rather fast. The
>         problem is that the database is replicated and I'm planning to
>         switch from streaming to logical. The problem is that it is
>         rather slow (30 minutes for the master and over 3 hours for the
>         replication, between data transfer and indexes).
> 
> 
>     I am not clear on what you did, so can you clarify the following:
> 
>     1) pg_upgrade from 9.2 master instance to 10.4 master instance, correct?
> 
>     2) What replication are you talking about for the 3 hour value?
> 
>     3) What is the 30 minute value referring to?
> 
>     4) When you say database are you talking about a Postgres cluster or
>     a database in the cluster?
> 
> 
>         Is there a way to speed up the replication or should I rather
>         stick to streaming replication? As I have only 1 database on the
>         server, it would not be a show-stopper.
> 
> 
>     See 4) above, but if you are talking about a single database in a
>     cluster streaming replication will not work for that.
> 
> 
> 
> 
>         Thanks in advance
>         Olivier Gautherot
>         http://www.linkedin.com/in/ogautherot
>         <http://www.linkedin.com/in/ogautherot;
> 
> 
> 
>     -- 
>     Adrian Klaver
>     adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (10+ messages)  latest in thread

Message-ID: <239dddd5-aa45-a7fe-b35a-085b978f8bd6@aklaver.com>
Permalink:  ../239dddd5-aa45-a7fe-b35a-085b978f8bd6@aklaver.com/
Also on:    postgresql.org/message-id/239dddd5-aa45-a7fe-b35a-085b978f8bd6@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, olivier@gautherot.net
  Subject: Re: Fast logical replication jump start with PG 10
  In-Reply-To: <239dddd5-aa45-a7fe-b35a-085b978f8bd6@aklaver.com>
  References: <CAJ7S9TVygExihaXt2E1bNH_0kGnx8bA62fmGreDGWTwb3_Pi7g@mail.gmail.com> <729c1726-2e61-f03f-fe7e-c1dcf3f59e85@aklaver.com> <CAJ7S9TWdYCi-FBhB4a5=gf7TfdZ=z6B+4wAQLAEJzZtoa0V3LA@mail.gmail.com> <239dddd5-aa45-a7fe-b35a-085b978f8bd6@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