public inbox for [email protected]  
help / color / mirror / Atom feed
From: Robert Haas <[email protected]>
To: Amit Kapila <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Petr Jelinek <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Tomas Vondra <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Kuntal Ghosh <[email protected]>
Cc: [email protected] <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: [BUG]Update Toast data failure in logical replication
Date: Mon, 24 Jan 2022 15:10:05 -0500
Message-ID: <CA+Tgmobef7QJYWrvguG3xpck71w-yfTJEMkhPW6n4zyB_V7kJw@mail.gmail.com> (raw)
In-Reply-To: <CAA4eK1JfajPqdmMQ2eeLMnY45wK+WivSrv6ncRXrmDRs8DZsZQ@mail.gmail.com>
References: <OS0PR01MB611342D0A92D4F4BF26C0F47FB229@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<OS0PR01MB61131DF0574EEFFECC157555FB229@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<OS0PR01MB6113D49D3AE7F0CA59679DA4FB229@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<CAFiTN-ve8w3NY89vYi9ck8HMMXjLc=2YTU+ZCoQZ_f2C-7oXhg@mail.gmail.com>
	<OS0PR01MB6113F5E14AFD98EF6B3B85CCFB3F9@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<CAFiTN-v-LSyGqu5AfJDjfGZup_Gp37dgzukPEhUUsAqy9RT7_A@mail.gmail.com>
	<CAFiTN-tir1MJUBaUSdspOJZZZXbZgzufwr8rpaXR2KZ0HBe8OA@mail.gmail.com>
	<OS0PR01MB61137DE0A63EC2AD65CFB35AFB3F9@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<CAFiTN-uS0UhHN0juRjjWA1aDMybnvNfqNtVbSQdap_1g6W_nGQ@mail.gmail.com>
	<OS0PR01MB6113D89BA71E6E1439073E69FB3E9@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<CAFiTN-ujnvSnzgAv5KLdAaGc8-CQh-U85vYAQOkadN2pejTK4w@mail.gmail.com>
	<CAFiTN-tJqa3J_s-fSoJEzk55_UGXmU9+8AOBypveiQM_qAwsGQ@mail.gmail.com>
	<OS0PR01MB6113DE0DE33A59A5240A9B6FFB3D9@OS0PR01MB6113.jpnprd01.prod.outlook.com>
	<CAFiTN-sD+eL4tDOmrBoy5VLihyyPwNycmw--oQOXNSGm52JzNg@mail.gmail.com>
	<CAGz5QCLND451Rc4iu9LsXLTOUV+z5nWNabOOaDzdBrQqAC+jEw@mail.gmail.com>
	<CAFiTN-v-VvDBOmK-RUp8=+fLuGS8BVjtvzUYj9Fq7A8cjYJjnA@mail.gmail.com>
	<CAFiTN-sTS4bB7W3UJV3iUm=wKdr9EpOwyK97hNr77MzFQm_NBw@mail.gmail.com>
	<CAA4eK1JnBquWvprsdYvO2JqzFXa9b5bnLK2vxr7Pj_3ZxE=gXg@mail.gmail.com>
	<CAFiTN-sK1qt+DawK9jV7RBCmvTx0quVhNj73yNyJCXBMO1+4DA@mail.gmail.com>
	<CAA4eK1Lp5nwAZc9RT=BEZ8_VCoGODFgtNWXFVJsdpGOmcr7Vdg@mail.gmail.com>
	<CAFiTN-tXm1rjhoN+rfEEsc7JW59yxWXM9vBGfy9nTTqVKj3cUQ@mail.gmail.com>
	<CAA4eK1+k2TKPmdeZxgp2vgFtv2C8+dMKHR=-ty9HswDcCqkK6A@mail.gmail.com>
	<CAA4eK1JfajPqdmMQ2eeLMnY45wK+WivSrv6ncRXrmDRs8DZsZQ@mail.gmail.com>

On Tue, Aug 10, 2021 at 1:20 AM Amit Kapila <[email protected]> wrote:
> It seems to me this problem exists from the time we introduced
> wal_level = logical in the commit e55704d8b2 [1], or another
> possibility is that logical replication commit didn't consider
> something to make it work. Andres, Robert, Petr, can you guys please
> comment because otherwise, we might miss something here.

I'm belatedly getting around to looking at this thread. My
recollection of this is:

I think we realized when we were working on the logical decoding stuff
that the key columns of the old tuple would have to be detoasted in
order for the mechanism to work, because I remember worrying about
whether it would potentially be a problem that the WAL record would
end up huge. However, I think we believed that the new tuple wouldn't
need to have the detoasted values, because logical decoding is
designed to notice all the TOAST insertions for the new tuple and
reassemble those separate chunks to get the original value back. And
off-hand I'm not sure why that logic doesn't apply just as much to the
key columns as any others.

But the evidence does suggest that there's some kind of bug here, so
evidently there's some flaw in that line of thinking. I'm not sure
off-hand what it is, though.

-- 
Robert Haas
EDB: http://www.enterprisedb.com






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [BUG]Update Toast data failure in logical replication
  In-Reply-To: <CA+Tgmobef7QJYWrvguG3xpck71w-yfTJEMkhPW6n4zyB_V7kJw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox