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 1msnh0-0005X1-1J for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 15:08:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msngy-000813-T8 for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 15:08:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msngy-00080M-Ie for pgsql-hackers@lists.postgresql.org; Thu, 02 Dec 2021 15:08:12 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msngv-0005ew-44 for pgsql-hackers@postgresql.org; Thu, 02 Dec 2021 15:08:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C25903201C92; Thu, 2 Dec 2021 10:08:06 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 02 Dec 2021 10:08:07 -0500 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=fm1; bh=QAShLua2lmLrkRVjJBNKQRQTyMV1ou2SkqS0dTUTx 1Q=; b=GOMIlDyN8kZkjoQAdePk6LZNO20eDb1G7taKwzMD3LfpmiMHc72IAMmYs tt8ip5yVom4BTLw8w7IIg8R952FcxfFv7hKsQZTeaNyo6eMWhV//5eoFQZC20DqA 7l4ekspUHQ0m3gPmpOQLsr0ttxnTWencgpwTEi3U6D+7MB1E9pVahsMgk/EMB1hk zdcpySidpcg3q9k5Seis95yHStDCOCs8HdSAh9ZcGOdQRckYf3Y8R8IT/8tzS6Ws FoNbWiqFi1VvsfnE2v63C8TzuONHti5IX8Y2WoPqXtHJLJmUD5Em90JkR5vZflCH OrAzDp7ngkZNX4Lisdz6B5d2L4AGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrieehgdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefjeegheetuefhveevudel ueeftdejteeiffetvdduhfdtieefgfeutedtveeggfenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Dec 2021 10:08:03 -0500 (EST) Message-ID: Date: Thu, 2 Dec 2021 16:08:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: Skipping logical replication transactions on subscriber side Content-Language: en-US To: Amit Kapila , "houzj.fnst@fujitsu.com" Cc: Masahiko Sawada , vignesh C , Greg Nancarrow , "tanghy.fnst@fujitsu.com" , "osumi.takamichi@fujitsu.com" , Alexey Lesovsky , PostgreSQL-development References: From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 02.12.21 07:48, Amit Kapila wrote: > a. ALTER SUBSCRIPTION ... [SET|RESET] SKIP TRANSACTION xxx; > b. Alter Subscription SET ( subscription_parameter [=value] > [, ... ] ); > c. Alter Subscription On Error ( subscription_parameter > [=value] [, ... ] ); > d. Alter Subscription SKIP ( subscription_parameter > [=value] [, ... ] ); > where subscription_parameter can be one of: > xid = > lsn = > ... > As per discussion till now, option (d) seems preferable. I agree. > In this, we > need to see how and what to allow as options. The simplest way for the > first version is to just allow one xid to be specified at a time which > would mean that specifying multiple xids should error out. We can also > additionally allow specifying operations like 'insert', 'update', > etc., and then relation list (list of oids). What that would mean is > that for a transaction we can allow which particular operations and > relations we want to skip. I don't know how difficult it would be, but allowing multiple xids might be desirable. But this syntax gives you flexibility, so we can also start with a simple implementation. > I am not sure what exactly we can provide to users to allow skipping > initial table sync as we can't specify XID there. One option that > comes to mind is to allow specifying a combination of copy_data and > relid to skip table sync for a particular relation. We might think of > not doing anything for table sync workers but not sure if that is a > good option. I don't think this feature should affect tablesync. The semantics are not clear, and it's not really needed. If the tablesync doesn't work, you can try the setup again from scratch.