Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vstgh-007ERT-1J for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Feb 2026 02:22:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vstgg-001RDs-0b for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Feb 2026 02:22:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vstgf-001RDk-2X for pgsql-hackers@lists.postgresql.org; Thu, 19 Feb 2026 02:22:41 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vstgd-0000000047n-008x for pgsql-hackers@lists.postgresql.org; Thu, 19 Feb 2026 02:22:40 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-3870778358aso4385421fa.1 for ; Wed, 18 Feb 2026 18:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771467758; cv=none; d=google.com; s=arc-20240605; b=BfFCsXxTd8SKOTSwCwM0F845AZSC72S3+wNXf3EMUcy6YsKO0la9TEwbPFMz9UM1uX a02Mb8wmXq/9pE3HD368l+Hn46N6WyZK1Aqic1kmkAHmvpbwuLF5nwgyMudYRNRliOUs +Bl2o65z4VGiZnkmHIY5wBgOjwtyI7zC9q8KQ/9IbUP+R17jLv0MtQN70khR78Iz9ok+ B6YIvuzkwGdniouV1Ap/8waqeixbOD6JSr1qdbWsg2bhiWCBuY2z9UhouCQTiI9qBiDW HZHWEypU+9rd/YqfinBDTXRhYgQnqAtTCh1KGen1WrIeeMod7m3DvkVF3Z81Rmvpc6qe ASeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ibyGHoNYsjdfsw+X84A0BvlEeMYWF1czCJYSD9Z+ehE=; fh=sDCQ/hZq8VGtBHqFTkGU5N+777li/TkCj6qqDhNi7Vs=; b=TW5LWhXM6NBFu/2reu608SftfxHARgMGRozea/F4LrTgLZ4syOlf7n4gEZdXibR7v/ kJisdrY/1SYITshoc+n44xzi5f7yQqigMJJkwfgGG6Tv7IZGIFbwT1umYGLhRfmDiP2v xNJbdBZl771zcbZZTMgqqECU3VPHHQPAnaL3VVQz9LuKDFwmE0oqB4m6YI/b/FGrLyg/ NoGsue1/V4/6R9sp2We3q0ni4Lx/oNYLAb8ps25vpwssnWTZAqETzOU8eXCGr3Og2g3K 62jHZUj9yi0qQ5nRonOQ5EZJddNW98C0tmA53La6lGTqqcz8U8kXz1MibHkI//n6IDfX cpOQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771467758; x=1772072558; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ibyGHoNYsjdfsw+X84A0BvlEeMYWF1czCJYSD9Z+ehE=; b=TY7eEb34rZvwBQ3t464lugVWv98GJ0KJEIY5Dmq7NRA/I9jhdRPQLNqR9CmhAiaiUe dBsAAnD1nkL8p9cTHMt36SxczR+ND0DuE4pqu/I3onCPIYcFIV2xSLaMKICHn0oeQR1a vcAGerBqdgHqsb9N0VpqvdUhhbW/CTAreZ5S8p+hhItWUxpKO0lgRQ0ElzOTTRH4M473 4LX2i8CTKITv9hpLJL5tMZOMD4zeLb6TI5p5aB/aTRLpPqnXA6gT+NYb42mCQ86oaBSZ g6hOXxODBqtV75175w9fPxdWSsrdVOsBYCVseVqn/D2ovz2by5Ip/vfmKpGkbuViRs7c gAOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771467758; x=1772072558; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ibyGHoNYsjdfsw+X84A0BvlEeMYWF1czCJYSD9Z+ehE=; b=KtgLG/aCM51mrDzNKHh5CnlECkf3w92WlLaDIDLtSD7GjnvqVpMsGSaHBxvlahG9bV MYrF+5X0Tn/76H9wb4S39ycSXOA7hPuEpGQeZN3y6feZj28jVM8e40YGktIrawBqhdTP gTKREFnKzt8/matpjUYizmo4aIetBAkFHU1UG+Ct5hdfKcp23J/5NXLhPPUWP9LsNcXC u7e0PllEy/v47SbP9bBGKs3kOVM2Z75CLkofr/NFZ8j8jRAlAv7LrFL1CH9gz3LLvkIN p481RdS1gBnwMzKzexdgTGkqv9M6XhIbbdKJd+g6Rf+IH0ZsDNZqHDGaWZ/xpUlva/pv xMIg== X-Forwarded-Encrypted: i=1; AJvYcCVDN8KoFWXtFICoDW8Mq93R70cFQZeeNexCJlBarjxriomcxDJFohkHrz+IUrNeeX9F0QTcCEk615vb8YcC@lists.postgresql.org X-Gm-Message-State: AOJu0YwOv5i3pROaIdXUpEwkHBRfdY39OemzOmwG02Zf//UIU04IxzLd Sc+kpq6KhN6HDQkeVP7atAaTnsiCrIXV6aQcQwG0jQIxWWpR4q0RowDBt6xEPXJZVCtHF8Tf4/a ydxjqjE5sx61I9dm6Tid2RMcLwnleOuDGVxzV+Dc= X-Gm-Gg: AZuq6aL9484zWNNEPFu95tV634oItr4bvBIOrISryzDPiQETBVY/HyBOVzEKyDPq1Ei nDaMFUbQjpMVJ95OsuduBp+3hsLMVk4vP43uNFpPvM9Drcy6oCLuaW/0hm4husSmxygZrewjw6y SAntO7MgnR0uycpUyxgWxRF9LJzpvDPzr/qF5HoPkns3meQExVYCAdV9WUU782IAeG3wvctfeNK UuPtCaQS2sr+xIzfpLB1C9GfGaRyGKLIT1g5BMexmtivd6usAOAJmKqBdwAo5S/ZLANyKlkRTmo hYvNo90z775JXy+AxDvjLRT2msDlao9MgjUSuMN1HW+cKq0LjZ3DpMILY/nryCmfBjI438zFeA= = X-Received: by 2002:a05:651c:1442:b0:387:1ba5:99ca with SMTP id 38308e7fff4ca-38810576c5bmr57290991fa.31.1771467758350; Wed, 18 Feb 2026 18:22:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Thu, 19 Feb 2026 07:52:26 +0530 X-Gm-Features: AaiRm53KV4FTPA72pHhls4Oy8cMLjXF8LkVS5e5i37EVOHUnfAbPrziN5J_t7aw Message-ID: Subject: Re: [PATCH] Support automatic sequence replication To: Peter Smith Cc: shveta malik , Ajin Cherian , Ashutosh Sharma , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Feb 19, 2026 at 3:26=E2=80=AFAM Peter Smith = wrote: > > On Wed, Feb 18, 2026 at 9:05=E2=80=AFPM shveta malik wrote: > > > ... > > 3) > > I noticed that copy_sequences is invoked twice per sync cycle=E2=80=94o= nce 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 =3D 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 =3D 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. --=20 With Regards, Amit Kapila.