Re: Re: Synch Rep: direct transfer of WAL file from the primary to the standby - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Re: Synch Rep: direct transfer of WAL file from the primary to the standby
Date
Msg-id 87skh7bnv3.fsf@hi-media-techno.com
Whole thread Raw
In response to Re: Re: Synch Rep: direct transfer of WAL file from the primary to the standby  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: Synch Rep: direct transfer of WAL file from the primary to the standby
List pgsql-hackers
Hi,

Tom Lane <tgl@sss.pgh.pa.us> writes:
> I think this fails the basic sanity check: do you need it to still work
> when the master is dead.  

I don't get it. Why would we want to setup a slave against a dead
master?

The way I understand the current design of Synch Rep, when you start a
new slave the following happen:
1. init: slave asks the master the current LSN and start streaming WAL
2. setup: slave asks the master for missing WALs from its current   position to this LSN it just got, and apply them
allto reach   initial LSN (this happen in parallel to 1.)
 
3. catchup: slave has replayed missing WALs and now is replaying the   stream he received in parallel, and which
appliesfrom init LSN   (just reached)
 
4. sync: slave is no more lagging, it's applying the stream as it gets   it, either as part of the master transaction
ornot depending on the   GUC settings
 

So, what I'm understanding you're saying is that the slave still should
be able to setup properly when master died before it synced. What I'm
saying is that if master dies before any sync slave exists, you get to
start from backups (filesystem snaphost + archives for example, PITR
recovery etc), as there's no slave.

Regards,
-- 
dim


pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: WIP: generalized index constraints
Next
From: Jan Urbański
Date:
Subject: Re: *_collapse_limit, geqo_threshold