Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBLtf-0002ri-Bm for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 16:04:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBLtd-0004Cs-T5 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 16:04:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBLtd-0004Cl-H3 for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2019 16:04:21 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBLta-0006RO-QN for pgsql-hackers@postgresql.org; Tue, 02 Apr 2019 16:04:20 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 5E131621B; Tue, 2 Apr 2019 12:04:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 02 Apr 2019 12:04:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=joRkVADlMkcJk0wONAGY4p4S9Ef 4aMGhfEeu9mt/3U8=; b=IsHf7Llyw/oOzBRRj7g40pUFiR4kRqpIryhy5v6SFlL MERjSDmcyMwc179FNghmh0EgW+JFrkQ6BgOmeJPS1moMmGMU1b1GNZb1uFjM506h Uy+lsvfjumFN88e7x/BTQ3UyEsCpf0iM65laPYTEyEuJpCzxyAjoaqMc0/xg9kNq ENQqNlWHBxbMsIG6Pu9SgPUOWkF7F5KqyHc/3MFq2SeFI2C67M7PVtgiTqVKVnBZ p0qraRpvTa/kE3ZFABwgc5ElFljRNS1QHRGci7bzz46i66mEASgSqTyjB7JACwY5 A/vPkIVocIzNfLbFLpKcvcm0prcZDFAk70GMr0QpGaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=joRkVA DlMkcJk0wONAGY4p4S9Ef4aMGhfEeu9mt/3U8=; b=iiY6cpBj/y13Bp9sUfl+Sl fvtKgvpOlvPr/7ORV01TqSW8pUHa8kOFDCuUYrO3CC6J3jGBWNRD/x/SW/uD5/e5 GaDOrZCVBQMSR0Hz1xftH9z+8EA+Kgic7suoenWWwZbFvIZAjqL/VBEEkkKBCGt5 /zMKAWng0QjAzNtk3iOTntiTrAgHWJjq67pakIhkB9sijyEEf3Y0zpGDpVKF01xC +X0EMoHmeRuG1SnwDUnxA+CFyKP8+MQk9BCRF4HN+GShHkGfh9S6ZxSB4bJx/htR Vg4EnwL6z3WuDtjTP+YZps5hcsSshcTUl9yLZH+/+knTm2Ttmsfa4+7ozQDtegRQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtddtgdejieculddtuddrgedutddrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvden ucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivg hlrdguvgeqnecukfhppeelkedrvddutddrudegtddrudejudenucfrrghrrghmpehmrghi lhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuih iivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id C2637E49E6; Tue, 2 Apr 2019 12:04:15 -0400 (EDT) Date: Tue, 2 Apr 2019 09:04:14 -0700 From: Andres Freund To: Amit Khandekar Cc: Robert Haas , Craig Ringer , Petr Jelinek , "pgsql-hackers@postgresql.org" Subject: Re: Minimal logical decoding on standbys Message-ID: <20190402160414.h4wwhetcpggmy3tv@alap3.anarazel.de> References: <20181212204154.nsxf3gzqv3gesl32@alap3.anarazel.de> <20181214005521.jaty2d24lz4nroil@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-02 15:26:52 +0530, Amit Khandekar wrote: > On Thu, 14 Mar 2019 at 15:00, Amit Khandekar wrote: > > I managed to get a recovery conflict by : > > 1. Setting hot_standby_feedback to off > > 2. Creating a logical replication slot on standby > > 3. Creating a table on master, and insert some data. > > 2. Running : VACUUM FULL; > > > > This gives WARNING messages in the standby log file. > > 2019-03-14 14:57:56.833 IST [40076] WARNING: slot decoding_standby w/ > > catalog xmin 474 conflicts with removed xid 477 > > 2019-03-14 14:57:56.833 IST [40076] CONTEXT: WAL redo at 0/3069E98 > > for Heap2/CLEAN: remxid 477 > > > > But I did not add such a testcase into the test file, because with the > > current patch, it does not do anything with the slot; it just keeps on > > emitting WARNING in the log file; so we can't test this scenario as of > > now using the tap test. > > I am going ahead with drop-the-slot way of handling the recovery > conflict. I am trying out using ReplicationSlotDropPtr() to drop the > slot. It seems the required locks are already in place inside the for > loop of ResolveRecoveryConflictWithSlots(), so we can directly call > ReplicationSlotDropPtr() when the slot xmin conflict is found. Cool. > As explained above, the only way I could reproduce the conflict is by > turning hot_standby_feedback off on slave, creating and inserting into > a table on master and then running VACUUM FULL. But after doing this, > I am not able to verify whether the slot is dropped, because on slave, > any simple psql command thereon, waits on a lock acquired on sys > catache, e.g. pg_authid. Working on it. I think that indicates a bug somewhere. If replay progressed, it should have killed the slot, and continued replaying past the VACUUM FULL. Those symptoms suggest replay is stuck somewhere. I suggest a) compiling with WAL_DEBUG enabled, and turning on wal_debug=1, b) looking at a backtrace of the startup process. Greetings, Andres Freund