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.
