Re: Streaming replication, and walsender during recovery - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Streaming replication, and walsender during recovery
Date
Msg-id 4B614101.2080603@enterprisedb.com
Whole thread Raw
In response to Re: Streaming replication, and walsender during recovery  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Streaming replication, and walsender during recovery  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Fujii Masao wrote:
> OK. Here is the patch which supports a walsender process during recovery;
> 
> * Change walsender so as to send the WAL written by the walreceiver
>   if it has been started during recovery.
> * Kill the walsenders started during recovery at the end of recovery
>   because replication cannot survive the change of timeline ID.

I think there's a race condition at the end of recovery. When the
shutdown checkpoint is written, with new TLI, doesn't a cascading
walsender try to send that to the standby as soon as it's flushed to
disk? But it won't find it in the WAL segment with the old TLI that it's
reading.

Also, when segments are restored from the archive, using
restore_command, the cascading walsender won't find them because they're
not written in pg_xlog like normal WAL segments.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Streaming replication and wal skipping
Next
From: Heikki Linnakangas
Date:
Subject: Re: Streaming replication and pg_xlogfile_name()