Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo6Qv-0006dP-EX for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Jun 2021 15:35:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lo6Qu-0000sM-E6 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Jun 2021 15:35:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo6Qu-0000sE-5z for pgsql-hackers@lists.postgresql.org; Tue, 01 Jun 2021 15:35:56 +0000 Received: from wforward5-smtp.messagingengine.com ([64.147.123.35]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo6Qq-0006Kq-0Q for pgsql-hackers@postgresql.org; Tue, 01 Jun 2021 15:35:55 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailforward.west.internal (Postfix) with ESMTP id 2790E245; Tue, 1 Jun 2021 11:35:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 01 Jun 2021 11:35:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=KeJHEMzzVkvGWsXp1PklNTRa7UD26U3+6sjDKDDwX r0=; b=IMDvfaQBMI1GT6V5XyGBw1hjWRtOFKd9HXFVkTbpLRpLCXF4M27cNyKvI WrhV47g+6X307wuakUTAlrmVXXuE/a984kHu/pmw+rcAXUetUjnPkCdnadiFjISk kfy6qC7FdC+mBvu5hjVRos2rxhETXpYYkZX5mA8Y/oa1dxDg6ot8WKpEjVmR+mEG +8YGNoqXsXWur5RL+MQngl1GUAxlai8g4YZM4gWVeljqetiZz0/w1YvAlwOShKcI DblkLYIaIl59P3Z7ziGqApDPlWOm7jMrG415EnU642PydjvAfSQCfECC/4MCVBrm nLJf8NpuFtdCYIdkjbYaTAUzfHeog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdelhedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepleevheehueeiudeiteei tdekueetleefteejffeiffdugedvffdvffdtiedvueeknecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht segvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Jun 2021 11:35:46 -0400 (EDT) Subject: Re: Skipping logical replication transactions on subscriber side To: Amit Kapila Cc: Masahiko Sawada , PostgreSQL-development References: From: Peter Eisentraut Message-ID: <1f0cd48d-81b0-e8ae-df8c-f6207d00f44a@enterprisedb.com> Date: Tue, 1 Jun 2021 17:35:44 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 01.06.21 06:01, Amit Kapila wrote: > But, won't that be costly in cases where we have errors in the > processing of very large transactions? Subscription has to process all > the data before it gets an error. I think we can even imagine this > feature to be extended to use commitLSN as a skip candidate in which > case we can even avoid getting the data of that transaction from the > publisher. So if this information is persistent, the user can even set > the skip identifier after the restart before the publisher can send > all the data. At least in current practice, skipping parts of the logical replication stream on the subscriber is a rare, emergency-level operation when something that shouldn't have happened happened. So it doesn't really matter how costly it is. It's not going to be more costly than the error happening in the first place. All you'd need is one shared memory slot per subscription to store a xid to skip. We will also want some proper conflict handling at some point. But I think what is being discussed here is meant to be a repair tool, not a policy tool, and I'm afraid it might get over-engineered.