Re: Proposal: Conflict log history table for Logical Replication

From: Zhijie Hou <houzhijie22(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-11-24 07:48:33
Message-ID: be72ef2f-34ca-47dd-8d1f-3f93ab0a0c2b@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Nov24, 2026 at 12:45 PM Peter Smith wrote:
> Some minor review comments for v96-0001 (code/comments)
>
> ======
> src/backend/replication/logical/conflict.c
>
> 1.
> +/*
> + * build_index_key_json
> + *
> + * Fetch replica identity key from the tuple table slot and convert into a
> + * JSON datum.
> + *
> + * The caller must ensure that the index with the OID 'indexid' is locked so
> + * that we can safely fetch and construct the replica identity key values.
> + * See comments atop ReportApplyConflict() for how this holds.
> + */
> +static Datum
> +build_index_key_json(EState *estate, Relation localrel,
> + Oid indexid, TupleTableSlot *slot,
> + bool *omitted)
>
> 1a. Function comment should describe the `omitted` parameter.
>
> ~
>
> 1b. IMO it might be good to Assert(*omitted == false); at the top of
> this function as a sanity check to ensure the caller has already
> assigned it.

Since it's a file-local static helper with a single caller right
below it that already initializes omitted = false, it would be
unnecessary to me for the extra Assert or comment here.

>
> ======
> src/backend/replication/logical/worker.c
>
> 2.
> /*
> * The tuple to be updated could not be found or was deleted. Do
> - * nothing except for emitting a log message.
> + * nothing except for reporting the conflict.
> */
>
> SUGGESTION (last sentence)
> Do nothing except report the conflict.
>
> ~~~
>
> 3.
> /*
> * The tuple to be updated could not be found or was
> - * deleted. Do nothing except for emitting a log message.
> + * deleted. Do nothing except for reporting the conflict.
> */
>
> SUGGESTION (last sentence)
> Do nothing except report the conflict.
>

I think the suggested text is not clearly better, so kept the current
text as is.

--
Best Regards,
Zhijie Hou

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-11-24 08:09:26 Re: [PATCH] Fix typo "Querys" in a pquery.c comment
Previous Message Zhijie Hou 2026-11-24 07:46:43 Re: Proposal: Conflict log history table for Logical Replication