Re: Conflict detection for update_deleted in logical replication - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Conflict detection for update_deleted in logical replication
Date
Msg-id CAA4eK1LYeK7zZ3mvG7gQgEZk=+f77PAYfskBv639E621iW+AiA@mail.gmail.com
Whole thread Raw
In response to Re: Conflict detection for update_deleted in logical replication  (shveta malik <shveta.malik@gmail.com>)
List pgsql-hackers
On Fri, May 16, 2025 at 12:01 PM shveta malik <shveta.malik@gmail.com> wrote:
>
> On Fri, May 16, 2025 at 11:15 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> >
> > BTW, another related point is that when we decide to stop retaining
> > dead tuples (via should_stop_conflict_info_retention), should we also
> > consider the case that the apply worker didn't even try to get the
> > publisher status because previously it decided that
> > oldest_nonremovable_xid cannot be advanced due to its
> > OldestActiveTransactionId?
> >
>
> Do you mean avoid  stop-conflict-retention in such a case as apply
> worker itself did not request status from the publisher? If I
> understood your point correctly, then we can do that by advancing the
> timer to a new value even if we did not update candidate-xid and did
> not ask the status from the publisher.
>

But candidate_xid_time is also used in wait_for_local_flush() to check
clock_skew between publisher and subscriber, so for that purpose, it
is better to set it along with candidate_xid. However, can't we rely
on the valid value of candidate_xid to ensure that apply worker didn't
send any request? Note that we always reset candidate_xid once we have
updated oldest_nonremovable_xid.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences
Next
From: Ilia Evdokimov
Date:
Subject: Re: Add comment explaining why queryid is int64 in pg_stat_statements