Re: New and interesting replication issues with 9.2.8 sync rep

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: New and interesting replication issues with 9.2.8 sync rep
Date: 2014-05-03 08:07:39
Message-ID: 20140503080739.GF12715@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-05-02 18:57:08 -0700, Josh Berkus wrote:
> Just got a report of a replication issue with 9.2.8 from a community member:
>
> Here's the sequence:
>
> 1) A --> B (sync rep)
>
> 2) Shut down B
>
> 3) Shut down A
>
> 4) Start up B as a master
>
> 5) Start up A as sync replica of B
>
> 6) A successfully joins B as a sync replica, even though its transaction
> log is 1016 bytes *ahead* of B.
>
> 7) Transactions written to B all hang
>
> 8) Xlog on A is now corrupt, although the database itself is OK

This is fundamentally borked practice.

> Now, the above sequence happened because of the user misunderstanding
> what sync rep really means. However, A should not have been able to
> connect with B in replication mode, especially in sync rep mode; that
> should have failed. Any thoughts on why it didn't?

I'd guess that B, while starting up, has written further WAL records
bringing it further ahead of A.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-05-03 08:09:56 Re: Sending out a request for more buildfarm animals?
Previous Message Jeff Janes 2014-05-03 07:13:45 Re: tab completion for setting search_path