On Thu, Feb 19, 2026 at 3:26 AM Peter Smith <[email protected]> wrote: > > On Wed, Feb 18, 2026 at 9:05 PM shveta malik <[email protected]> wrote: > > > ... > > 3) > > I noticed that copy_sequences is invoked twice per sync cycle—once for > > sequences in the INIT state, and once for sequences in the READY state > > to detect drift. This means we ping the primary twice during each sync > > cycle. We should consider combining this logic into a single > > copy_sequences call. Since we already have the state information > > (INIT, READY, etc.) for each local sequence, copy_sequences can > > internally check the current state and decide whether to transition a > > sequence to READY based on its previous state. This approach would > > allow us to fetch all required information from the primary in a > > single call. > > > > I also think that we do not even need to mention the states here and > > we can give a single message instead of 2: > > DEBUG: logical replication sequence synchronization for subscription > > "sub1" - for sequences in INIT state batch #1 = 5 attempted, 5 > > succeeded, 0 mismatched, 0 insufficient permission, 0 missing from > > publisher, 0 skipped, 0 no drift > > DEBUG: logical replication sequence synchronization for subscription > > "sub1" - for sequences in READY state batch #1 = 5 attempted, 0 > > succeeded, 0 mismatched, 0 insufficient permission, 0 missing from > > publisher, 0 skipped, 5 no drift > > > > Those are DEBUG1 messages, not LOG messages, so I think the primary > goal is to ensure that they are full of useful information to help > debugging. Knowing the prior state information means we know that the > "drift" logic was needed when deciding to sync or not. > > If message volume can be reduced without any loss of debugging > usefulness, then great, but we need to take care not to throw the baby > out with the bath water. >
I think it is useful to discuss how much DEBUG information is required. However, I would like to know if this is related to the patch being discussed or a case in HEAD? If later, then it is better to discuss it separately and address it as a separate patch if required. -- With Regards, Amit Kapila.
