Re: Checkpoint replication slots later

From: Hüseyin Demir <huseyin(dot)d3r(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Ants Aasma <ants(at)cybertec(dot)at>
Subject: Re: Checkpoint replication slots later
Date: 2026-07-12 06:06:03
Message-ID: CAB5wL7YVvOKPp-=Gs-QbKRhQiRSn5nj35F=ti61L1EA_L3bQmQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I revisited the CheckPointSnapBuild() and
> CheckPointLogicalRewriteHeap(). Both functions work idempotently and
> are safe to move after CheckPointReplicationSlots(). They benefit from
> the updated last_saved_restart_lsn computed in the current checkpoint
> cycle, enabling more accurate cleanup decisions.
>
> I ran regression testing comparing the baseline (master) version with
> the patched version:
>
> - Checkpoint duration: No change.
> - WAL retention: More accurate, because it uses the current
> replication slot state.
> - Regressions: None detected.
> - Dependencies: No new dependencies introduced.
>
> Please see the v2 as attached but we can also commit the v1 since the
> only difference is the order of CheckPointSnapBuild and
> CheckPointLogicalRewriteHeap working idempotently.

Rebased it against the head.

Regards,
Demir.

Attachment Content-Type Size
v3-0001-Checkpoint-replication-slots-late-in-the-cycle.patch application/octet-stream 1.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hüseyin Demir 2026-07-12 07:47:12 Re: [PATCH] pg_upgrade: add --initdb option to create the new cluster automatically
Previous Message ZizhuanLiu X-MAN 2026-07-12 03:00:34 Re: support create index on virtual generated column.