From: | John H <johnhyvr(at)gmail(dot)com> |
---|---|
To: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> |
Cc: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Introduce XID age based replication slot invalidation |
Date: | 2025-09-19 23:42:56 |
Message-ID: | CA+-JvFvb8ePiEb1pM8QzqN7deTtnv1M6r+iBqXBiNZhR+z3caw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Hayato,
Thank you for taking a look.
> > The patch currently attempts to invalidate once-per-autovacuum worker.
> > We're wondering if it should attempt invalidation on a per-relation
> > basis within the vacuum call itself. That would account for scenarios
> > where the cost_delay or naptime is high between autovac executions.
>
> I have a concern that age calculation acquire the lock for XidGenLock thus
> performance can be affected. Do you have insights for it?
Are you concerned if we did the check on a per table case? Or in the
current situation
where it's only once per-worker.
> >
> > Invalidation happens in CHECKPOINT, similar to
> > 'idle_replication_slot_timeout', and when VACUUM occurs.
>
> Let me confirm because I'm new. VACUUM can also trigger because old XID make
> VACUUM fail, right? Timeout is aimed for WAL thus it is not so related with VACUUM,
> which does not recycle segments.
>
I feel that the timeout is used as a way to roughly address storage
accumulation or VACUUM
not progressing due to slots.
> In contrast, is there a possibility that XID-age check can be done only at VACUUM?
It's also done in CHECKPOINT because there can be stale replication
slots on standby that
aren't there on writer. We would still want them to be invalidated.
> Regarding the patch, try_replication_slot_invalidation() and ReplicationSlotIsXIDAged()
> do the same task. Can we reduce duplicated part?
Thanks for catching, I thought I did this but guess not. Updated in
the latest attachment.
--
John Hsu - Amazon Web Services
Attachment | Content-Type | Size |
---|---|---|
0045-Add-XID-age-based-replication-slot-invalidation.patch | application/octet-stream | 22.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Davis | 2025-09-20 00:21:34 | Built-in case-insensitive collation pg_unicode_ci |
Previous Message | Daniel Gustafsson | 2025-09-19 21:04:56 | Re: encode/decode support for base64url |