RE: Collect statistics about conflicts in logical replication

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Subject: RE: Collect statistics about conflicts in logical replication
Date: 2024-08-27 09:50:44
Message-ID: OS3PR01MB57184B166C4C9A12983085A594942@OS3PR01MB5718.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday, August 27, 2024 10:59 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> ~~~
>
> 3.
> +# Enable track_commit_timestamp to detect origin-differ conflicts in
> +logical # replication. Reduce wal_retrieve_retry_interval to 1ms to
> +accelerate the # restart of the logical replication worker after encountering a
> conflict.
> +$node_subscriber->append_conf(
> + 'postgresql.conf', q{
> +track_commit_timestamp = on
> +wal_retrieve_retry_interval = 1ms
> +});
>
> Later, after CDR resolvers are implemented, it might be good to revisit these
> conflict test cases and re-write them to use some conflict resolvers like 'skip'.
> Then the subscriber won't give ERRORs and restart apply workers all the time
> behind the scenes, so you won't need the above configuration for accelerating
> the worker restarts. In other words, running these tests might be more efficient
> if you can avoid restarting workers all the time.
>
> I suggest putting an XXX comment here as a reminder that these tests should
> be revisited to make use of conflict resolvers in the future.

I think it would be too early to mention the resolution implementation detail
in the comments considering that the resolution is still not RFC. Also, I think
reducing wal_retrieve_retry_interval is a reasonable way to speed up the test
in this case because the test is not letting the worker to restart all the time, the
error causes the restart will be resolved immediately after the stats check. So, I
think adding XXX is not very appropriate.

Other comments look good to me.
I slightly adjusted few words and merged the changes. Thanks !

Here is V3 patch.

Best Regards,
Hou zj


Attachment Content-Type Size
v3-0001-Collect-statistics-about-conflicts-in-logical-rep.patch application/octet-stream 25.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-08-27 10:03:31 Re: Segfault in jit tuple deforming on arm64 due to LLVM issue
Previous Message Masahiro.Ikeda 2024-08-27 09:35:24 RE: Doc: fix the note related to the GUC "synchronized_standby_slots"