Re: Conflict detection for update_deleted in logical replication

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Conflict detection for update_deleted in logical replication
Date: 2025-08-13 10:45:41
Message-ID: CAJpy0uC2iSBZuSPtXA5YS6g6VUroY010sxE6yYSNNOP4w5iELg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 13, 2025 at 10:41 AM Zhijie Hou (Fujitsu)
<houzj(dot)fnst(at)fujitsu(dot)com> wrote:
>
>
> Here is the V61 patch set which addressed above comments and the comment by Nisha[2].
>

Thank You for the patch. I tested the patch, please find a few comments:

1)
Now when it stops-retention and later resumes it due to the fact that
max_duration is meanwhile altered to 0, I get log:

LOG: logical replication worker for subscription "sub1" resumes
retaining the information for detecting conflicts
DETAIL: The time spent applying changes up to LSN 0/17DD728 is now
within the maximum limit of 0 ms.

I did not get which lsn it is pointing to? Is it some dangling lsn
from when it was retaining info? Also the msg looks odd, when it says
'is now within the maximum limit of 0 ms.'

2)
While stopping the message is:
LOG: logical replication worker for subscription "sub1" will stop
retaining conflict information
DETAIL: The time spent advancing the non-removable transaction ID has
exceeded the maximum limit of 1000 ms.

And while resuming:
logical replication worker for subscription "sub1" resumes retaining
the information for detecting conflicts
----------

We can make both similar. Both can have 'retaining the information for
detecting conflicts' instead of 'conflict information' in first one.

3)
I believe the tenses should also be updated. When stopping, we can say:

Logical replication worker for subscription "sub1" has stopped...

This is appropriate because it has already stopped by pre-setting
oldest_nonremovable_xid to Invalid.

When resuming, we can say:
Logical replication worker for subscription "sub1" will resume...

This is because it will begin resuming from the next cycle onward,
specifically after the launcher sets its oldest_xid.

4)
For the DETAIL part of resume and stop messages, how about these:

The retention duration for information used in conflict detection has
exceeded the limit of xx.
The retention duration for information used in conflict detection is
now within the acceptable limit of xx.
The retention duration for information used in conflict detection is
now indefinite.

thanks
Shveta

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2025-08-13 10:46:45 RE: Parallel Apply
Previous Message Amit Kapila 2025-08-13 10:08:55 Re: Proposal: Conflict log history table for Logical Replication