Re: Proposal: Conflict log history table for Logical Replication

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(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-01-14 02:17:45
Message-ID: CAHut+Pv75sX82S_Tb_V+32YKrqFpsbJ_h+gRYEhNaqB9skKOAQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Some review comments for patch v21-0003.

======

(v21-0003 is identical to v20-0003. None of my v20-0003 review
comments have been addressed yet.)

~~~

Anyway, here is one more review comment:

1.
The DOCS for CREATE SUBSCRIPTION say:
+ <literal>pg_conflict</literal> schema. This allows for
easy querying and
+ analysis of conflicts. This table is automatically
dropped when the
+ subscription is removed.

The DOCS for ALTER SUBSCRIPTION also say:
+ exist. Conversely, if the destination is changed to
+ <literal>log</literal>, logging to the table stops and the internal
+ table is automatically dropped.

~

I felt these topics about the CLT auto-removal need to be more
prominent, like in a <caution> note or something similar, to recommend
that the user must make a *backup* of the CLT first, if they intend to
do post-mortem analysis of the conflict. Maybe the best place to put
this <caution> is in the CREATE SUBSCRIPTION / Parameters /
conflict_log_desttination = table section.

IMO "post-mortem" implies first dropping the subscription (e.g.
because it might be in some kind of apply retry-loop conflicting over
and over and over), and then studying the logs/CLT to figure out where
it went wrong. Therefore, it would be bad if the user wants to exactly
that kind of study, only to find that they've accidentally also
deleted all the CLT evidence when they dropped the subscription.

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2026-01-14 02:19:02 Re: GIN pageinspect support for entry tree and posting tree
Previous Message Peter Smith 2026-01-14 02:09:53 Re: Proposal: Conflict log history table for Logical Replication