Re: Proposal: Conflict log history table for Logical Replication

From: kedar anavardekar <kedar(dot)anavardekar(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-09-30 11:10:27
Message-ID: CAJZSXGpp46n6VOnEsqod9b3dz+Z45dxoqcPcyEWTA9T5WYf9tw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is a slightly different topic than the one discussed in the email.

opposite to what mentioned in the docs:
+ If a key value is larger than 1kB it is not recorded. In its place the
+ conflict log stores a small object marking it as omitted and giving its
+ size, and sets <literal>has_omitted_values</literal> for that row:
+<programlisting>
+ {"id":"1","tag":"abc","doc":{"omitted":true,"length":4096}}
+</programlisting>
+ Large values are dropped rather than shortened, because a shortened value
+ would still look like a real one and would give wrong answers when
+ compared or joined against the table.

For the case you mentioned in Case:A, the oversized value is PK itself and
The contents logged to the CLT are like:

relid | conflict_type | replica_identity_full |
replica_identity | local_conflicts | has_om
itted_values
-------+----------------+-----------------------+-------------------------------------------+-----------------+-------
-------------
16432 | delete_missing | f |
{"b":{"omitted":true,"length":200000000}} | | t

Would logging a shortened value or preview (which would fit within the column
size limits) to the CLT provide more information or value to the user?

As from the current information which is getting logged as shown above
user might not get useful
information about the conflict.
--
Thanks & Regards,
Kedar

> Thoughts?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-09-30 11:12:01 Re: [PATCH v1] Fix out-of-bounds access in pg_bsd_indent's parser stack
Previous Message jian he 2026-09-30 11:04:25 Re: on_error table, saving error info to a table