From: Andres Freund <andres@anarazel.de>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: 德哥 <digoal@126.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
Date: Tue, 16 Jun 2015 21:21:41 +0200
Message-ID: <20150616192141.GD2626@alap3.anarazel.de> (raw)
In-Reply-To: <CAMkU=1yimhjiQv_4=HDmvRDqhKAe+AUVg_uu-GP_vRkpsek3xQ@mail.gmail.com>
References: <20150615090523.2735.53140@wrigleys.postgresql.org>
<CAMkU=1w4AgJ38rcpdiERot6QRrgfPPMYuK-Q=J5Jy4D_ZZ6Avw@mail.gmail.com>
<CAB7nPqTQu2ebecsRpzy8F7bN_Kwa5GkEDJ2MQcK2WE0O6DBTPw@mail.gmail.com>
<CAMkU=1yimhjiQv_4=HDmvRDqhKAe+AUVg_uu-GP_vRkpsek3xQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2015-06-16 10:00:13 -0700, Jeff Janes wrote:
> On Mon, Jun 15, 2015 at 5:52 PM, Michael Paquier <michael.paquier@gmail.com>
> wrote:
> I haven't looked at the code, or paid much attention when the feature went
> in. From the docs, I thought that is what would happen as well. But
> experimentally, that only happens if hot_standby_feedback is on. I get the
> same behavior
> on 9.4.4 and on 9.5devel.
>
> postgresql.conf:
>
> wal_level = logical
> max_wal_senders = 3
> max_replication_slots = 3
> hot_standby = on
> hot_standby_feedback = off ## toggled on standby over course of
> experiment
> port=5433 ### on standby only. default on master
>
> on master:
> SELECT * FROM pg_create_physical_replication_slot('node_a_slot');
>
> recovery.conf:
> standby_mode = 'on'
> primary_conninfo = 'port=5432 user=jjanes'
> primary_slot_name = 'node_a_slot'
>
> I repeat Digoal's example, only don't crash the standby.
>
> I leave the stand-by connected, with a client sitting in a repeatable read
> transaction, and then delete the tuples on the master side. Vacuum will
> quickly reclaim the tuples, and then after 30s the stand-by session gets
> disconnect due to conflict. When I toggle hot_standby_feedback on, then it
> behaves as expected, with the master never cleaning up the deleted tuples.
It's expected that we only hold up the xmin horizon on the primary via
slots if hot_standby_feedback is enabled. It seemed - and still seems -
like a bad idea to force hs_feedback to on if slots are used, using it
is much more expensive than just retaining WAL. Do you disagree?
Where do the docs imply the contrary?
Greetings,
Andres Freund
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, jeff.janes@gmail.com, michael.paquier@gmail.com, digoal@126.com
Subject: Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
In-Reply-To: <20150616192141.GD2626@alap3.anarazel.de>
References: <20150615090523.2735.53140@wrigleys.postgresql.org> <CAMkU=1w4AgJ38rcpdiERot6QRrgfPPMYuK-Q=J5Jy4D_ZZ6Avw@mail.gmail.com> <CAB7nPqTQu2ebecsRpzy8F7bN_Kwa5GkEDJ2MQcK2WE0O6DBTPw@mail.gmail.com> <CAMkU=1yimhjiQv_4=HDmvRDqhKAe+AUVg_uu-GP_vRkpsek3xQ@mail.gmail.com> <20150616192141.GD2626@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox