public inbox for [email protected]  
help / color / mirror / Atom feed
From: Amit Kapila <[email protected]>
To: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: Ajin Cherian <[email protected]>
Cc: shveta malik <[email protected]>
Cc: Ashutosh Sharma <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: [PATCH] Support automatic sequence replication
Date: Tue, 24 Feb 2026 11:47:24 +0530
Message-ID: <CAA4eK1KYxQALt46k5uWOO6SUtNjvjOaXwfNjH0AU656YrcGZEw@mail.gmail.com> (raw)
In-Reply-To: <OS9PR01MB12149D9054CC7F2DC3F0D26A1F577A@OS9PR01MB12149.jpnprd01.prod.outlook.com>
References: <CAFPTHDZXX9WQ_X1ZfEvS248T+pKuk6SmCnXcvgPM059N1xPUfA@mail.gmail.com>
	<CAJpy0uDLUEjHHME8om1vAf6qkXCeRR6cBvkpK8yWBAC=T0ZFLA@mail.gmail.com>
	<CAFPTHDZg1JrunGgOj332hr+gUuH_Jm7skqPpYSvd-QE3yEdRDQ@mail.gmail.com>
	<CAJpy0uBz7MCSUkvFJD9ij65vBahNmY+bfCgdGKRqXovYs+K_TA@mail.gmail.com>
	<CAJpy0uDsuNqjWd-TmGBxqSS1rnVCJ3B8=SYrtxQ=Vs8kb71QFA@mail.gmail.com>
	<CAJpy0uAMWg3KcXtVBS7B0rnchLNrCCVYBByJCzAp=u5LERgtfA@mail.gmail.com>
	<CAFPTHDZwEhxhDAeqcPi0GuYN6xBs8gFXHOMUnbg3u2Xigcz4Zg@mail.gmail.com>
	<CAE9k0PmTyCU1A9YEf+MRgfeZ8yK1bAYJu=o0bH8DNUTzXejQyQ@mail.gmail.com>
	<CAA4eK1L6czEzG4mLNZSyjYC5nX0FMSjjk3csKuxPD3Ph5-7Yvw@mail.gmail.com>
	<CAJpy0uAhGQJ=msVsn2GsqWXr+YESJK6x9NBvrUtKvtvp1OVuKQ@mail.gmail.com>
	<CAJpy0uAOuu-M6wobH2wHOdTymm-cX9+MqwPyRNoOt=sPKBdCew@mail.gmail.com>
	<CAFPTHDZiWYXoKoo4VcBYNH9a=gxDZhfkcBeXt5w6cLw4_ysyKw@mail.gmail.com>
	<OS9PR01MB12149D9054CC7F2DC3F0D26A1F577A@OS9PR01MB12149.jpnprd01.prod.outlook.com>

On Mon, Feb 23, 2026 at 6:56 AM Hayato Kuroda (Fujitsu)
<[email protected]> wrote:
>
> 05. LogicalRepApplyLoop()
>
> MaybeLaunchSequenceSyncWorker() should be called more; otherwise, the sequencesync
> worker won't be launched if the worker always receives messages and WL_TIMEOUT does
> not happen. Can you add most of the places under maybe_advance_nonremovable_xid()?
> Personally considered, no need to add within `else if (c == PqReplMsg_PrimaryStatusUpdate)`
> because it just consumes status updates from the primary.
>

I don't think we need to be as aggressive as
maybe_advance_nonremovable_xid because not doing that can lead to
bload if slot is not advanced. The only minor downside with checking
too frequently is that we need to traverse the all logical replication
workers to find if sequencesync worker is available. I feel doing in
ProcessSyncingRelations() where earlier we were doing
ProcessSequencesForSync() should be sufficient. Can we find some cheap
way to detect if sequencesync worker is present or not? Can you think
some other way to not incur the cost of traversing the worker array
and also detect sequence worker exit without much delay?

...
>
> 07.
> Question: Can we introduce an intermediate state, such as SYNC, to clarify
> whether synchronization is proceeding?
>

What is the advantage of this? For external purposes, the presence of
sequencesync worker, which can be checked via pg_stat_subscription
should be sufficient.

BTW, what is the behavior of REFRESH SEQUENCES command if the sequence
worker is active? Does it still try to refresh sequences, if so, is
that required/good idea?

-- 
With Regards,
Amit Kapila.






view thread (58+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Support automatic sequence replication
  In-Reply-To: <CAA4eK1KYxQALt46k5uWOO6SUtNjvjOaXwfNjH0AU656YrcGZEw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox