Re: Introduce XID age and inactive timeout based replication slot invalidation

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Ajin Cherian <itsajin(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation
Date: 2024-08-26 06:14:05
Message-ID: CALj2ACVu0EJ+QQ7W0oHbL_+hCtk+p-00MNhE4hfjFcXaMepMfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 14, 2024 at 9:20 AM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
> Some minor comments on the patch:

Thanks for reviewing.

> 1.
> + /*
> + * Release the lock if it's not yet to keep the cleanup path on
> + * error happy.
> + */
>
> I suggest rephrasing to: " "Release the lock if it hasn't been already to ensure smooth cleanup on error."

Changed.

> 2.
>
> elog(DEBUG1, "performing replication slot invalidation");
>
> Probably change it to "performing replication slot invalidation checks" as we might not actually invalidate any slot here.

Changed.

> 3.
>
> + ReplicationSlotsComputeRequiredXmin(false);
> + ReplicationSlotsComputeRequiredLSN();
> + }
>
> Is this calculation of resource limits really required here when the same is already done inside InvalidateObsoleteReplicationSlots()

Nice catch. Removed.

Please find the attached v42 patches.

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

Attachment Content-Type Size
v42-0001-Add-inactive_timeout-based-replication-slot-inva.patch application/x-patch 33.2 KB
v42-0002-Add-XID-age-based-replication-slot-invalidation.patch application/x-patch 32.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2024-08-26 06:23:44 pg_upgrade: Support for upgrading to checksums enabled
Previous Message Peter Eisentraut 2024-08-26 06:09:19 Support POSITION with nondeterministic collations