| From: | Dilip Kumar <dilipbalaut(at)gmail(dot)com> |
|---|---|
| To: | shveta malik <shveta(dot)malik(at)gmail(dot)com> |
| Cc: | 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>, vignesh C <vignesh21(at)gmail(dot)com> |
| Subject: | Re: Proposal: Conflict log history table for Logical Replication |
| Date: | 2026-01-05 09:43:41 |
| Message-ID: | CAFiTN-t-TAn9NhfVCC7KMNN=SW5x0o2QwjSc9VzieBixLm9CMA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Jan 5, 2026 at 12:11 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Thu, Jan 1, 2026 at 4:01 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > Few comments on v17-003.
> > <The doc does not compile.>
> >
> > logical-replication.sgml
> > 1)
> > + <link linkend="sql-dropsubscription"><command>DROP
> > SUBSCRIPTION</command></link>. When the
> > + <literal>conflict_log_destination</literal> parameter is set to
> > <literal>table</literal>
> > + or <literal>all</literal>, the system automatically manages a
> > dedicated conflict
> > + storage table. This table is dropped automatically when the subscription is
> > + removed via <command>DROP SUBSCRIPTION</command>.
> >
> > + <para>
> > + Conflicts that occur during replication are typically logged as plain text
> > + in the server log, which can be difficult for automated monitoring and
> > + analysis. The <command>CREATE SUBSCRIPTION</command> command provides the
> > + <link linkend="sql-createsubscription-params-with-conflict-log-destination">
> > + <literal>conflict_log_destination</literal></link> option to record detailed
> > + conflict information in a structured, queryable format, significantly
> > + improving post-mortem analysis and operational visibility of the replication
> > + setup by logging to a system-managed table.
> > +
> >
> > Do we really need these at 2 places in the same section? The 2nd
> > paragraph can be tweaked to include the first one and placed at the
> > end of that section. How about:
> >
> > Conflicts that occur during replication are, by default, logged as plain text
> > in the server log, which can make automated monitoring and analysis difficult.
> > The <command>CREATE SUBSCRIPTION</command> command provides the
> > <link linkend="sql-createsubscription-params-with-conflict-log-destination">
> > <literal>conflict_log_destination</literal></link> option to record detailed
> > conflict information in a structured, queryable format. When this parameter
> > is set to <literal>table</literal> or <literal>all</literal>, the system
> > automatically manages a dedicated conflict storage table, which is created
> > and dropped along with the subscription. This significantly improves post-mortem
> > analysis and operational visibility of the replication setup.
>
> Yeah I am fine with doing this.
>
> > 2)
> > + in the following <firstterm>conflict</firstterm> cases. If the subscription
> > + was created with the <literal>conflict_log_destination</literal> set to
> > + <literal>table</literal>, detailed conflict information is also inserted
> > + into an internally managed table named
> >
> > + When the <literal>conflict_log_destination</literal> is set to
> > + <literal>table</literal>, the system automatically creates a new table with
> > + a predefined schema to log conflict details.
> >
> > Should we mention 'all' also in both of above:
>
> Make sense.
>
> > 3)
> > + <literal>pg_conflict.conflict_log_table_<subscription_oid></literal>,
> >
> > I think we can not write <subscription_oid>, it will look for
> > finishing tag </sub..>.
>
> Will fix.
>
> > 4)
> > The log format for logical replication conflicts is as follows:
> >
> > We can even modify this line to something like:
> > If <literal>conflict_log_destination</literal> is left at the default
> > setting or explicitly configured
> > as <literal>log</literal> or <literal>all</literal>, logical
> > replication conflicts are logged in the following format:
>
> +1
>
> > 5)
> > alter_subscription.sgml:
> > +
> > + <para>
> > + When switching <literal>conflict_log_destination</literal> to
> > <literal>table</literal>,
> > + the system will ensure the internal logging table exists. If
> > switching away
> > + from <literal>table</literal>, the logging stops, but the
> > previously recorded
> > + data remains until the subscription is dropped.
> > + </para>
> >
> > I do not think this info is true. We drop the table when we alter
> > conflict_log_destination to set a non-table value.
>
> Will fix this.
>
> > 6)
> > In create_subscription.sgml where we talk about conflict log table,
> > shall we also point to its structure mentioned in the Conflict page?
>
> I do not understand this, do you mean the schema of the conflict log
> table? For that we already have a dedicated section[1]?
>
> <table id="logical-replication-conflict-log-schema">
> <title>Conflict Log Table Schema</title>
> <tgroup cols="3">
> <thead>
> <row>
> <entry>Column</entry>
> <entry>Type</entry>
> <entry>Description</entry>
> </row>
> </thead>
Here is the updated version of patch, Vignesh's patches must be
rebased again on the new version.
--
Regards,
Dilip Kumar
Google
| Attachment | Content-Type | Size |
|---|---|---|
| v18-0003-Doccumentation-patch.patch | application/octet-stream | 11.3 KB |
| v18-0001-Add-configurable-conflict-log-table-for-Logical-.patch | application/octet-stream | 101.0 KB |
| v18-0002-Implement-the-conflict-insertion-infrastructure-.patch | application/octet-stream | 33.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | shveta malik | 2026-01-05 09:45:08 | Re: [Patch] add new parameter to pg_replication_origin_session_setup |
| Previous Message | cca5507 | 2026-01-05 09:43:27 | Re: Fix outdated comments in catcache.h |