Re: Streaming Replication (Master Delta Sync) - Mailing list pgsql-admin

From Albe Laurenz
Subject Re: Streaming Replication (Master Delta Sync)
Date
Msg-id D960CB61B694CF459DCFB4B0128514C208902834@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Re: Streaming Replication (Master Delta Sync)  (Lonni J Friedman <netllama@gmail.com>)
Responses Re: Streaming Replication (Master Delta Sync)  (Parkirat Bagga <parkiratbagga@gmail.com>)
List pgsql-admin
Lonni J Friedman wrote:
>> Does rsysc sync's the partial logs as well. As I would be doing the rsync
>> from old master to new master (when the old master recovers), there might be
>> some partial logs present in the old master?
> 
> I don't think that's how WAL works.  The log is either complete, or it
> doesn't exist.  Anyway, rsync will sync whatever exists when invoked.
> I'm sure that its got some crazy options to exclude files based on
> certain criteria if you wanted to investigate them.

It's not true that a WAL is either complete or nonexistent.

We should distinguish between active WALs (in pg_xlog) and archived WALs.

Active WALs are not necessarily complete - there is always one that
is being written to and hence incomplete.
Archived WALs are always complete, but unless the postmaster on the
primary is down, it could be that rsync copies a partial WAL archive
that is just being written.

Still the advice to rsync WALs is right.  That will allow the standby
to catch up as much as possible.  An incomplete active WAL is no problem,
it will be recovered as far as possible.

>> Delay is there because both the machines are on cloud and they are in
>> different regions. I was thinking in terms of having multiple connections so
>> that the transfer between 2 regions may become faster.

There is always only one connection.
Is the change rate on the database high?
A silly question: are the clocks on primary and standby fairly in sync
or may it be time skew between those machines that you observe?

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: WAL corruption while replication
Next
From: "Albe Laurenz"
Date:
Subject: Re: Postgresql switch over process