Re: pgsql: Track last_inactive_time in pg_replication_slots.

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Kapila <akapila(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Track last_inactive_time in pg_replication_slots.
Date: 2024-03-26 05:43:55
Message-ID: CALj2ACXxL8w5FiTtwLTk0fs-a-YPHGwMCx0Y-XVty7CojNH2uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Mar 26, 2024 at 9:38 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Mon, Mar 25, 2024 at 9:54 PM Bertrand Drouvot
> <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > On Mon, Mar 25, 2024 at 07:32:11PM +0530, Amit Kapila wrote:
> > > On Mon, Mar 25, 2024 at 6:57 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > > > And I'm suspicious that having an exception for slots being synced is
> > > > a bad idea. That makes too much of a judgement about how the user will
> > > > use this field. It's usually better to just expose the data, and if
> > > > the user needs helps to make sense of that data, then give them that
> > > > help separately.
> > >
> > > The reason we didn't set this for sync slots is that they won't be
> > > usable (one can't use them to decode WAL) unless standby is promoted
> > > [2]. But I see your point as well. So, I have copied the others
> > > involved in this discussion to see what they think.
> >
> > Yeah I also see Robert's point. If we also sync the "last inactive time" field then
> > we would need to take care of the corner case mentioned by Shveta in [1] during
> > promotion.
>
> I have suggested one potential solution for that in [1]. Please have a look.
>
> [1]: https://www.postgresql.org/message-id/CAJpy0uB-yE%2BRiw7JQ4hW0%2BigJxvPc%2Brq%2B9c7WyTa1Jz7%2B2gAiA%40mail.gmail.com

I posted the v21 patch implementing the above idea in the other thread
- https://www.postgresql.org/message-id/CALj2ACXRFx9g7A9RFJZF7eBe%3Dzxk7%3DapMRFuCgJJKYB7O%3Dvgwg%40mail.gmail.com.
For ease, I'm also attaching the patch in here.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v21-0001-Fix-review-comments-for-slot-s-last_inactive_tim.patch application/octet-stream 21.2 KB

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-03-26 07:20:33 Re: pgsql: make dist uses git archive
Previous Message Kyotaro Horiguchi 2024-03-26 05:01:16 Re: pgsql: pg_createsubscriber: creates a new logical replica from a standb

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-03-26 05:55:11 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Bharath Rupireddy 2024-03-26 05:37:51 Re: Introduce XID age and inactive timeout based replication slot invalidation