Re: [BUG]Update Toast data failure in logical replication
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, Petr Jelinek <petr.jelinek@enterprisedb.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Andres Freund <andres@anarazel.de>, Kuntal Ghosh <kuntalghosh.2007@gmail.com>, "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-08-10T14:38:48Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
WAL log unchanged toasted replica identity key attributes.
- 5e01001ffb38 15.0 landed
- b5e060473273 10.21 landed
- 1cd5802ac69a 11.16 landed
- ce349cf176e2 12.11 landed
- caa231be97df 13.7 landed
- 04645bbcae72 14.3 landed
-
Add new wal_level, logical, sufficient for logical decoding.
- e55704d8b2fe 9.4.0 cited
-
Add the notion of REPLICA IDENTITY for a table.
- 07cacba983ef 9.4.0 cited
On 2021-Jul-30, Amit Kapila wrote: > I was thinking of using toast pointer but that won't work because it > can be different on the subscriber-side. I don't see any better ideas > to fix this issue. This problem seems to be from the time Logical > Replication has been introduced, so adding others (who are generally > involved in this area) to see what they think about this bug? I think > people might not be using toasted columns for Replica Identity due to > which this problem has been reported yet but I feel this is quite a > fundamental issue and we should do something about this. In the evening before going offline a week ago I was looking at this and my conclusion was that this was a legitimate problem: the original implementation is faulty in that the full detoasted value is required to be transmitted in order for downstream to be able to read the value. I am not sure if at the level of logical decoding it is a problem theoretically, but at least for logical replication it is clearly a practical problem. Reading Dilip's last posted patch that day, I had some reservations about the API of ExtractReplicaIdentity. The new argument makes for a very strange to explain behavior "return the key values if they are unchanged, *or* if they are toasted" ... ??? I tried to make sense of that, and tried to find a concept that would make sense to the whole, but couldn't find any obvious angle in the short time I looked at it. I haven't looked at it again. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte" (Ijon Tichy en Viajes, Stanislaw Lem)