Re: Proposal: Conflict log history table for Logical Replication

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Narayanan Venkateswaran <narayananvpostgres(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(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>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-11-03 13:49:01
Message-ID: CAFiTN-vTY8o_m4ugd3yt4SD6YuYXLT5z69J-L+gHHzGvkRhJqw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 3, 2026 at 5:38 PM Narayanan Venkateswaran
<narayananvpostgres(at)gmail(dot)com> wrote:
>
> Hi,
>
> I looked at v89 of the patch, I had just one small comment (different
> from the comments posted already),
>
> In insert_conflict_log_tuple(): we have the following lines
>
> + if (remote_commit_ts > 0)
> + values[attno++] = TimestampTzGetDatum(remote_commit_ts);
> + else
> + nulls[attno++] = true;
>
> I think "if (remote_commit_ts != 0)" would be better for the following reasons,
>
> 1. build_local_conflicts_json_array() just above checks "if (conflicttuple->ts)"
> 2. The patch also has the line,
>
> + TimestampTz commit_ts; /* remote commit ts; 0 if unknown */
>
> we explicitly define 0 as the sentinel when the remote commit
> timestamp is unknown

Yeah make sense, and also for consistency with conflicttuple->ts we
can check, if (remote_commit_ts != 0) or if (remote_commit_ts)

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2026-11-03 13:53:01 Re: Asynchronous MergeAppend
Previous Message Amit Langote 2026-11-03 13:41:31 Re: [PATCH] Fix segmentation fault caused by reentrancy in RI_Fkey_cascade_del (ri_triggers.c)