Re: Improve pg_sync_replication_slots() to wait for primary to advance

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance
Date: 2025-10-13 07:57:36
Message-ID: CAFPTHDawFyqWuBM2r5imMsodzzZT+KdrFicesu7NksnE7PCfpg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 7, 2025 at 10:43 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
>
> Yes, we can control naptime based on the fact whether any slots are
> being advanced on primary. This is how a slotsync worker does. It
> keeps on doubling the naptime if there is no activity on primary
> starting from 200ms till max of 30 sec. As soon as activity happens,
> naptime is reduced to 200ms again.
>

I have modified the patch to use the same wait logic as the slotsync
worker. I have also incorporated the document changes that you shared.
Attaching v16 with the above changes.

regards,
Ajin Cherian
Fujitsu Australia

Attachment Content-Type Size
v16-0001-Improve-initial-slot-synchronization-in-pg_sync_.patch application/octet-stream 22.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-10-13 08:08:54 Re: bug, ALTER TABLE call ATPostAlterTypeCleanup twice for the same relation
Previous Message Jasper Smit 2025-10-13 07:48:45 Visibility bug in tuple lock