Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4wQh-0001ni-J1 for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Jun 2015 19:21:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z4wQh-0004BL-31 for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Jun 2015 19:21:51 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z4wQf-0004BA-W2 for pgsql-bugs@postgresql.org; Tue, 16 Jun 2015 19:21:50 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Z4wQc-00047q-4K for pgsql-bugs@postgresql.org; Tue, 16 Jun 2015 19:21:48 +0000 Received: from intern.anarazel.de (unknown [137.122.64.65]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id E1CF5860003; Tue, 16 Jun 2015 21:21:43 +0200 (CEST) Date: Tue, 16 Jun 2015 21:21:41 +0200 From: Andres Freund To: Jeff Janes Cc: Michael Paquier , =?utf-8?B?5b635ZOl?= , Pg Bugs Subject: Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect Message-ID: <20150616192141.GD2626@alap3.anarazel.de> References: <20150615090523.2735.53140@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2015-06-16 10:00:13 -0700, Jeff Janes wrote: > On Mon, Jun 15, 2015 at 5:52 PM, Michael Paquier > 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