pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Initial load from standby in logical replication. 3+ messages / 2 participants [nested] [flat]
* Initial load from standby in logical replication. @ 2019-01-31 13:55 Radoslav Nedyalkov <rnedyalkov@gmail.com> 0 siblings, 1 reply; 3+ messages in thread From: Radoslav Nedyalkov @ 2019-01-31 13:55 UTC (permalink / raw) To: pgsql-general Hi All, We want to setup a logical replica with initial load from physical standby. (all pg10.5) Basically what we tested is: 1.on the master: create publication and logical slot. 2.on the standby: pause the stanby. (lsn from 1. is already replayed). 3.on the standby: get last replayed lsn, pg_last_wal_replay_lsn(). 4.export/import the data into the logical replica. 5.on the logical replica: create subscription with pg_replication_origin_advance'd to the lsn from 3. 6.on the logical replica: enable subscription. On a test setup with some bulk inserts results are encouraging. Still we're not that confident. Does the procedure looks okay? What if standby is paused at COMMIT lsn? Thanks! Radoslav Nedyalkov ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Initial load from standby in logical replication. @ 2019-01-31 14:08 Achilleas Mantzios <achill@matrix.gatewaynet.com> parent: Radoslav Nedyalkov <rnedyalkov@gmail.com> 0 siblings, 1 reply; 3+ messages in thread From: Achilleas Mantzios @ 2019-01-31 14:08 UTC (permalink / raw) To: pgsql-general@lists.postgresql.org On 31/1/19 3:55 μ.μ., Radoslav Nedyalkov wrote: > Hi All, > We want to setup a logical replica with initial load from physical standby. (all pg10.5) > Basically what we tested is: > 1.on the master: create publication and logical slot. > 2.on the standby: pause the stanby. (lsn from 1. is already replayed). > 3.on the standby: get last replayed lsn, pg_last_wal_replay_lsn(). > 4.export/import the data into the logical replica. > 5.on the logical replica: create subscription with pg_replication_origin_advance'd to the lsn from 3. > 6.on the logical replica: enable subscription. > > On a test setup with some bulk inserts results are encouraging. > Still we're not that confident. Does the procedure looks okay? > What if standby is paused at COMMIT lsn? Who is gonna consume data from the primary's replication slot? If there is no subscriber connected and reading data, then the primary will think that the subscriber is down and will accumulate WALs till some replication client is connected to it (which will not happen since the subscriber points to the standby). > > Thanks! > Radoslav Nedyalkov > > > > > > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Initial load from standby in logical replication. @ 2019-01-31 14:29 Radoslav Nedyalkov <rnedyalkov@gmail.com> parent: Achilleas Mantzios <achill@matrix.gatewaynet.com> 0 siblings, 0 replies; 3+ messages in thread From: Radoslav Nedyalkov @ 2019-01-31 14:29 UTC (permalink / raw) To: Achilleas Mantzios <achill@matrix.gatewaynet.com>; +Cc: pgsql-general@lists.postgresql.org On Thu, Jan 31, 2019 at 4:09 PM Achilleas Mantzios < achill@matrix.gatewaynet.com> wrote: > On 31/1/19 3:55 μ.μ., Radoslav Nedyalkov wrote: > > Hi All, > > We want to setup a logical replica with initial load from physical > standby. (all pg10.5) > > Basically what we tested is: > > 1.on the master: create publication and logical slot. > > 2.on the standby: pause the stanby. (lsn from 1. is already replayed). > > 3.on the standby: get last replayed lsn, pg_last_wal_replay_lsn(). > > 4.export/import the data into the logical replica. > > 5.on the logical replica: create subscription > with pg_replication_origin_advance'd to the lsn from 3. > > 6.on the logical replica: enable subscription. > > > > On a test setup with some bulk inserts results are encouraging. > > Still we're not that confident. Does the procedure looks okay? > > What if standby is paused at COMMIT lsn? > Who is gonna consume data from the primary's replication slot? If there is > no subscriber connected and reading data, then the primary will think that > the subscriber is down and will accumulate WALs > till some replication client is connected to it (which will not happen > since the subscriber points to the standby). > Yes. that's clear. Primary will accumulate WALs until logical replica connects to it. The point is to offload the primary from massive initial copying. > > Thanks! > > Radoslav Nedyalkov > > > -- > Achilleas Mantzios > IT DEV Lead > IT DEPT > Dynacom Tankers Mgmt > > > ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-01-31 14:29 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-01-31 13:55 Initial load from standby in logical replication. Radoslav Nedyalkov <rnedyalkov@gmail.com> 2019-01-31 14:08 ` Achilleas Mantzios <achill@matrix.gatewaynet.com> 2019-01-31 14:29 ` Radoslav Nedyalkov <rnedyalkov@gmail.com>
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