On Thu, Sep 18, 2025 at 10:22 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Amit Kapila <amit.kapila16@gmail.com> writes:
> > On Thu, Sep 18, 2025 at 8:56 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> +1 for the first change, but for this:
> >>
> >> - ? errdetail("Retention is re-enabled as the apply process is advancing its xmin within the
configuredmax_retention_duration of %u ms.",
> >> + ? errdetail("Retention is re-enabled because the apply process can advance its xmin within
theconfigured max_retention_duration of %u ms.",
> >>
> >> would it be better to say
> >>
> >> "Retention is re-enabled because the apply process was able to advance its xmin within the configured
max_retention_durationof %u ms."
>
> > xmin is not yet advanced. In this state, we ensured that the
> > subscriber has caught up with the publisher and now the apply worker
> > can start maintaining/advancing its xmin.
>
> Hm, so what has max_retention_duration got to do with it?
>
It is the duration used to avoid subscriber being too much behind
publisher (and hence leading to retaining dead tuples for conflict
detection for a very long time). If the apply worker on the subscriber
is not caught up for this (max_retention_duration) duration then we
stop retaining dead tuples. Similarly, when the apply worker is able
to catch up before max_retention_duration is elapsed, we will resume
retention.
>
That
> is, should the message just read
>
> "Retention is re-enabled because the apply process can advance its xmin."
> or better
> "Retention is re-enabled because the apply process has caught up with the publisher."
>
> This now reminds me of a point that I meant to make in my previous
> reply and forgot: this whole business of "advancing xmin" is
> implementation jargon.
>
Yeah, this sounds clear but shall we consider using
max_retention_duration like: "Retention is re-enabled because the
apply process has caught up with the publisher within the configured
max_retention_duration.". We can have a single message if we don't
want to specify the value of max_retention_duration or simply skip
adding max_retention_duration.
--
With Regards,
Amit Kapila.