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 1oMBnb-0000TS-Ku for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Aug 2022 17:16:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oMBna-0007qn-Ih for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Aug 2022 17:16:46 +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 1oMBnZ-0007pt-Dn for pgsql-hackers@lists.postgresql.org; Thu, 11 Aug 2022 17:16:46 +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 1oMBnV-0006JL-29 for pgsql-hackers@postgresql.org; Thu, 11 Aug 2022 17:16:44 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id DBA913200906; Thu, 11 Aug 2022 13:16:38 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute2.internal (MEProxy); Thu, 11 Aug 2022 13:16:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1660238198; x=1660324598; bh=ERMFc6wAxh nMfcnEpgVudhpuBHdrg/A7KFtYHdOCXoA=; b=GeA6zovDsG5tJmj4HafCuApi4g Hu1eAP84nihrDkB/rLma4QWBmyt400R78fR7n8d0wq+X3SQ6yHiryi8qHejooyOw 8vSXIY+zhKfBY9er50OsHRE86SCzDu19vToaIna0QjrZ01mMT4tsy5JVQJh6Bw8Z /JUXiKwk4ko3ufg2KQnqcy1+g3H56zw19A7dCVRivnQo7AKga7mHfsPKdJ8COsWp KzZC1TX7KpD8P7FSccUBYGGbts/eKKbYtKw3srdpAXStrVW7Gjj4eXgCG11Mnh32 YPpozXRGNdeRMKzMFiy1JYerWzliuftWpwJy+fkaYjsdeZ9ro86yrMrQaDUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references: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=1660238198; x=1660324598; bh=ERMFc6wAxhnMfcnEpgVudhpuBHdr g/A7KFtYHdOCXoA=; b=XwUG3bGKmIPZrBZFHR01nXQQIVWLb+t6Lfu/ayu8o+8X MyftE10rTaT3ZqLOxJQ/OCT/CnZLaKK+e0/3cNId7sT0X9uDtNHuASipKLgaWkad 5aPg7GWY6auzIEwuyb86LWhid5hnf4ZVmotxSQ07nMVfoqvu8EGjst16UsxGymVP NMw0r9V+w/Whqfbt2gJVzKQESfxL5QIDxyQdlEn7plx7Y6N7QOY61LqwV598ZeJ2 E0kLKdvq+0XaM4PTsGMY+iNCK+J2p9mHTjoClWYRg7vRGWCLMjMMtl+C0dLyamYw uKYDH8lWJWFDAFzJfarZl61ID96CwIT6rsvGEVWnVQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeggedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesrgdtreerreertdenucfhrhhomhepfdfg uhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenuc ggtffrrghtthgvrhhnpefgffejvdeivdekvdeivdetudeikeduieevtdfhhfduvdetgeel teeiffekgefhvdenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhes vghulhgvrhhtohdrtghomh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 27E3115A0087; Thu, 11 Aug 2022 13:16:38 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-811-gb808317eab-fm-20220801.001-gb808317e Mime-Version: 1.0 Message-Id: In-Reply-To: References: <2ebc7ea8-3c46-474e-aea7-5d73ff6165fb@www.fastmail.com> <7cf14e66-8cea-406f-9607-607a397292f6@www.fastmail.com> Date: Thu, 11 Aug 2022 14:15:17 -0300 From: "Euler Taveira" To: "Melih Mutlu" Cc: "Amit Kapila" , pgsql-hackers Subject: Re: Allow logical replication to copy tables in binary format Content-Type: multipart/alternative; boundary=889885ee166a49f3ba6ece1d8af98042 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --889885ee166a49f3ba6ece1d8af98042 Content-Type: text/plain On Thu, Aug 11, 2022, at 10:46 AM, Melih Mutlu wrote: > If such restrictions are already the case for replication phase after initial table sync, then it shouldn't prevent us from enabling binary option for table sync. Right? I didn't carefully examine the COPY code but I won't expect significant differences (related to text vs binary mode) from the logical replication protocol. After inspecting the git history, I took my argument back after checking the commit 670c0a1d474. The initial commit 9de77b54531 imposes some restrictions (user-defined arrays and composite types) as mentioned in the commit message but it was removed in 670c0a1d474. My main concern is to break a scenario that was previously working (14 -> 15) but after a subscriber upgrade it won't (14 -> 16). I would say that you should test some scenarios: 014_binary.pl and also custom data types, same column with different data types, etc. > How is any issue that might occur due to version mismatch being handled right now in repliaction after table sync? > What I understand from the documentation is if replication can fail due to using different pg versions, it just fails. So binary option cannot be used. [1] > Do you think that this is more serious for table sync and we need to restrict binary option with different publisher and subscriber versions? But not for replication? It is a conservative argument. If we didn't allow a publisher to run COPY in binary mode while using previous Postgres versions, we know that it works. (At least there aren't bug reports for logical replication using binary option.) Since one of the main use cases for logical replication is migration, I'm concerned that it may not work (even if the binary option defaults to false, someone can decide to use it for performance reasons). I did a quick test and the failure while using binary mode is not clear. Since you are modifying this code, you could probably provide additional patch(es) to make it clear that there is an error (due to some documented restriction). -- Euler Taveira EDB https://www.enterprisedb.com/ --889885ee166a49f3ba6ece1d8af98042 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Thu, Aug 11,= 2022, at 10:46 AM, Melih Mutlu wrote:
If such restrictions are already the case for replica= tion phase after initial table sync, then it shouldn't prevent us from e= nabling binary option for table sync. Right?
=
I didn't carefully examine the COPY code but I won't e= xpect significant
differences (related to text vs binary m= ode) from the logical replication
protocol. After inspecti= ng the git history, I took my argument back after
checking= the commit 670c0a1d474. The initial commit 9de77b54531 imposes some
=
restrictions (user-defined arrays and composite types) as men= tioned in the
commit message but it was removed in 670c0a1= d474. My main concern is to break a
scenario that was prev= iously working (14 -> 15) but after a subscriber upgrade
it won't (14 -> 16). I would say that you should test some scenario= s:
014_binary.pl and also custom data types, same column w= ith different data
types, etc.

How is any issue that might occur due to vers= ion mismatch being handled right now in repliaction after table syn= c?
What I understand from the documentation is if replicat= ion can fail due to using different pg versions, it just fails. So binar= y option cannot be used. [1]
Do you think that this is mor= e serious for table sync and we need to restrict binary option with diff= erent publisher and subscriber versions? But not for replication?
It is a conservative = argument. If we didn't allow a publisher to run COPY in
bi= nary mode while using previous Postgres versions, we know that it works.= (At
least there aren't bug reports for logical replicatio= n using binary option.)
Since one of the main use cases fo= r logical replication is migration, I'm
concerned that it = may not work (even if the binary option defaults to false,
someone can decide to use it for performance reasons).
I did a quick test and the failure while using binary mode = is not clear. Since
you are modifying this code, you could= probably provide additional patch(es) to
make it clear th= at there is an error (due to some documented restriction).

= --
Euler Taveira

--889885ee166a49f3ba6ece1d8af98042--