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 1nlVN9-0001m9-ES for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2022 12:41:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nlVN7-0003Be-2K for pgsql-hackers@arkaria.postgresql.org; Mon, 02 May 2022 12:41:49 +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 1nlVN6-0003AC-6d for pgsql-hackers@lists.postgresql.org; Mon, 02 May 2022 12:41:48 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlVN1-00072E-Vw for pgsql-hackers@lists.postgresql.org; Mon, 02 May 2022 12:41:47 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 32E7B5801E0; Mon, 2 May 2022 08:41:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 02 May 2022 08:41:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1651495301; x=1651502501; bh=9VOHlboXMFd0SjyGGyDL9jNqoBwL O+/s4K7oX87Jv5w=; b=G7PP3I9+mxkKJtkrtyQAEowwseAiv6qWLhtlK19xAZYk snLQUA0CxRToNueMwmFXu2iZUjHfxb0I0Y/+eNd26bq6a+dJNi2sOHiay2ioX+NO Rz4uP72Avl5/2Debyn2TMolUh4pAFxB9SXTFZlEELNRA2BJap3jtP7f1mKyMa45S wwjFIy4Y5yEz2ObYVQC0VjfK7EAEw0WF2iRkVEhfzcb5UErbYIG8BRveQk3h2pTR KgwAqSJq1JqvpekGwnin6C/GPRp6XakaMg3/zwf8D4SAD7KtVdR+sR63qDc3wHXo +n1rmuB2Y6WomrJlozcu75aQSINaaExPkPaWj0AX9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuphgrmhdqkffkrffuuhhmmhgvrhculdehuddvmdenucfjughrpeffhffvvefukfggtggu gfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlh hvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedv kedtffduffdtffffheffhfejjefhgfeiueeukeejkeffgfdufffhudffffeuveenucffoh hmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqd hiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 May 2022 08:41:40 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 13C012A0FD1; Mon, 2 May 2022 13:44:15 +0200 (CEST) Date: Mon, 2 May 2022 13:44:15 +0200 From: Alvaro Herrera To: Amit Kapila Cc: Tomas Vondra , Peter Eisentraut , Pg Hackers Subject: Re: bogus: logical replication rows/cols combinations Message-ID: <202205021144.zkbvyekn52v7@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-May-02, Amit Kapila wrote: > We don't do that currently but we can as mentioned in my previous > email [1]. Let me write the relevant part again. We need to expose all > publications for a walsender, and then we can find the exact set of > publications where the current publication is used with other > publications and we can check only those publications. So, if we have > three walsenders (walsnd1: pub1, pub2; walsnd2 pub2; walsnd3: pub2, > pub3) in the system and we are currently altering publication pub1 > then we need to check only pub3 for any conflicting conditions. Hmm ... so what happens in the current system, if you have a running walsender and modify the publication concurrently? Will the subscriber start getting the changes with the new publication definition, at some arbitrary point in the middle of their stream? If that's what we do, maybe we should have a signalling system which disconnects all walsenders using that publication, so that they can connect and receive the new definition. I don't see anything in the publication DDL that interacts with walsenders -- perhaps I'm overlooking something. > I think it is possible to expose a list of publications for each > walsender as it is stored in each walsenders > LogicalDecodingContext->output_plugin_private. AFAIK, each walsender > can have one such LogicalDecodingContext and we can probably share it > via shared memory? I guess we need to create a DSM each time a walsender opens a connection, at START_REPLICATION time. Then ALTER PUBLICATION needs to connect to all DSMs of all running walsenders and see if they are reading from it. Is that what you have in mind? Alternatively, we could have one DSM per publication with a PID array of all walsenders that are sending it (each walsender needs to add its PID as it starts). The latter might be better. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La rebeldía es la virtud original del hombre" (Arthur Schopenhauer)