Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: 德哥 <digoal(at)126(dot)com>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
Date: 2015-06-16 00:52:48
Message-ID: CAB7nPqTQu2ebecsRpzy8F7bN_Kwa5GkEDJ2MQcK2WE0O6DBTPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jun 16, 2015 at 4:30 AM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> On Mon, Jun 15, 2015 at 2:05 AM, <digoal(at)126(dot)com> wrote:
>> http://www.postgresql.org/docs/devel/static/warm-standby.html#STREAMING-REPLICATION
>>
>> 25.2.6. Replication Slots
>> Replication slots provide an automated way to ensure that the master does
>> not remove WAL segments until they have been received by all standbys, and
>> that the master does not remove rows which could cause a recovery conflict
>> even when the standby is disconnected.
>>
>> In my test, master will remove rows when standby disconnect.
>
>
> I can't reproduce this. In my hands when the standby crashes, tuples on the
> master are not removed until either that slot is destroyed on the master, or
> until the standby reconnects.

Yep.

> Can you show us all the settings changes you have made to postgresql.conf
> and recovery.conf, and to the replication slots table?

Yes, perhaps the standby has already acknowledged the dead tuples
before you shut it down.

> One potential doc bug I see is that the it seems to imply that replication
> slots replaces the need for hot_standby_feedback, when it fact it must be
> used in conjunction with it. Do you have hot_standby_feedback turned on in
> the standby?

As far as I recall, using replication slots implies that the
RecentGlobalXmin horizon is updated to guarantee the presence of
tuples on the standby once it reconnects. Perhaps I am missing
something?
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 德哥 2015-06-16 01:20:39 Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
Previous Message Michael Paquier 2015-06-16 00:06:14 Re: Lack of Sanity Checking in file 'misc.c' for PostgreSQL 9.4.x