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 1vy6EX-00HQFt-2G for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 10:47:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vy6EW-00GtwH-0D for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Mar 2026 10:47:08 +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 1vy6EV-00Gtw9-1r for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2026 10:47:08 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vy6ET-00000000WPr-3Z5i for pgsql-hackers@lists.postgresql.org; Thu, 05 Mar 2026 10:47:06 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-389fa352b0eso127017441fa.1 for ; Thu, 05 Mar 2026 02:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772707623; cv=none; d=google.com; s=arc-20240605; b=ZCaqBA9/WKvAiZxBDrZWtECy3fP4KG3C0e+ZzYDvC1xKJf5eIpgXH/H1kQf4RhPpcT VQTW8ibAj+nj7UMH4eZsftNuOGl/yIxHt8J85qBWM/D+RsEDGuulr8zy3fXKG1UnNqAo 1jIuh5ADd7z1Tf7cMRYv7+f9fVvl1T4j3x0FjM7Q+CFoZjljs1opC6wZ+AKsJZOMIGX6 zQf9XmPwYeT55vzUJeVPbk4+tzbOAPad8hoRaoLMk7nE9ckXvmYzjaEPMLZ6RaLueaw0 iaErgbW4d6ZiZyh9r7FRtrWQbc4ckhpaj6Hz30wylHdk6LV+EYr4phUcPilnAY7pdKFu L3YQ== 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=X1OlVf7T9x4mjt5pLI8q5PUaA5Ri/SedFt2fjfUk1Ds=; fh=4BFqnFWceow7G2G278UBm0+c8t7N9t5tK8LmF0TmW7o=; b=aVp8nFo82mApzjp8CLPSSETbZ4dLVS1enps++80+MHZRftzamsnN14LQhLdhQ8AE4j 1eT5OHnH9n25zpQUZ8iQSV14A77GmVUkApAwAWSm+v/q3V06f1eWngClcGmHfMKoo13x 1ixlL5FdXPWmx+SWGDVYlrvL0TSCOFk2M28wMSv8B0LFXt7z+x/1pcfiMdrpK23/LAHC DmYaPDTPaJKag93nYDhaidACD70LiVKD4839koHAoSVw3i45WllGPk4uZGwy4vIwTaju z97bNii6fBPaMf6Ktu6Z9qEwkMM+UXJwQs2x6+XjE6WRG8uianYb1DENwjeyQl9A0oRW zFjA==; 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=1772707623; x=1773312423; 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=X1OlVf7T9x4mjt5pLI8q5PUaA5Ri/SedFt2fjfUk1Ds=; b=FfCmNEkvnxSSIkpf0TnIUcD0LfQO76xym2BhI+MZdGk9S6+6DG782XtdeTWLZVD335 3kFai14loGZ3yg8R+ZcNYERgdqPnreLX0vEznwsbaNBqaEuq2w6gZMLsY/6h4yVY+ID9 fyZBj/s69KLCeVqeKEFtCwu4rfpNwjRe8OZAuCvdfBUfKe8CtCDt4MOj4QywYLWu7MK0 mCf9ReAffN7R0Ed6XnYy8fffK3clJFrj1Vl08GPl8qDh0fRkyHJ6yorDfkOEVKNM+TKK gwepxnC9sgknmppbErls2kHoZUb4XZfAJFBtRDGt5uQhNIj3bU1pX/DgGTIHTF/Mr7c0 LFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772707623; x=1773312423; 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=X1OlVf7T9x4mjt5pLI8q5PUaA5Ri/SedFt2fjfUk1Ds=; b=VEG1bxeBn/azpq2CkfxfW7vIaYbt8JIkuoqtGPC9jdlpoT+NqKJyUi/tL+pTk21v6+ z4FRl1LgR7aVNGPkJQH1wR73MscfjuwxDgSwMrmSghVSFQjfiJfRpnZnzbD25sf4ke/E TRGYYvOm+RmWpCEnbwpnYlCsoSdJcUHvxI87gCLfl7zz21vls9ncOLMYzf00ZcbeDB3/ 15TriKS+uGrA/I/gNTi111miW2uJAynXdZZ8SVuzdtNAiIvaFCG/GVTEaeFzNESTlIH+ Bg5I9LRej/2AYmb2FlXx69EmEuaa2YaxA/C0L+FI+i2fhrBNUh9EgW4EjuOjZgvqFHtz uvMg== X-Forwarded-Encrypted: i=1; AJvYcCU/BqZ8pkW1u1E8iXuKnpV7LQVrXDI5fkKuxlXF2J4VSwqHl5Z2e8JR3TPE6h5vyw/HvQDWPSddHPwifuxQ@lists.postgresql.org X-Gm-Message-State: AOJu0YxesH1CFduqrOQ+Ql40ty8tdsb7fN/V6gAoegdnzAY6Biwn1FO/ NC77UZ0STGItqChGq+lQmzb5QlQemPJsWeO3DlABnpmr5KsGxzznhtZ5v2zQHG73chPGec6vRGz QA3l8TMFY6QlCtIxjs3tJz0XvRZPky+k= X-Gm-Gg: ATEYQzw+nyIiQ22qhuNSPvQn17/+dRIiS2GiV7/20TMov1xqWm4NbeyWg14t69HHVKc CJJ+VBIe0XgUBu8FQDWjF2ncbAqykTMsySGA2gghOWLuGgAztf3kPazvBNBtZQEexpDFh/M77za SYnYAR9qoV7Smv7X0sk+EOk1WPWKgvuA9jtypC5vVyUWoL+gGv/4iye14q3XPBHI2DPvPWWmSIs Q27+yDL0cSB3lzGJ0BkiEANNrY2cHDnT9HEpkUVvS1rcBvIca4W3Lqk+7/tRL0R86wHmlsKyJpg ELXyYsE1bnGkKg2JPkpCclZS4py1xSLCgMT5 X-Received: by 2002:a05:651c:1585:b0:386:8f97:d0ad with SMTP id 38308e7fff4ca-38a2c7b0bf7mr29452041fa.25.1772707622312; Thu, 05 Mar 2026 02:47:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Thu, 5 Mar 2026 16:16:50 +0530 X-Gm-Features: AaiRm50leOl5kpt9x0kHEYOx58hkCEdq1gTWgDCFCuTakCeVLP4kl2qum5Vqjew Message-ID: Subject: Re: [PATCH] Support automatic sequence replication To: shveta malik Cc: "Zhijie Hou (Fujitsu)" , Ajin Cherian , "Hayato Kuroda (Fujitsu)" , 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, Mar 5, 2026 at 9:35=E2=80=AFAM shveta malik wrote: > > > 3) > + /* Sleep for the configured interval */ > + (void) WaitLatch(MyLatch, > + WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH, > + sleep_ms, > + WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE); > > I don't think this wait-event is appropriate. Unlike tablesync, we are > not waiting for any state change here. Shall we add a new one for our > case? How about WAIT_EVENT_LOGICAL_SEQSYNC_MAIN? Thoughts? > +1 for a new wait event. Few other minor comments: 1. + * Check if the subscription includes sequences and start a sequencesync + * worker if one is not already running. The active sequencesync worker wi= ll + * handle all pending sequence synchronization. If any sequences remain + * unsynchronized after it exits, a new worker can be started in the next + * iteration. * - * Start a sequencesync worker if one is not already running. The active - * sequencesync worker will handle all pending sequence synchronization. I= f any - * sequences remain unsynchronized after it exits, a new worker can be sta= rted - * in the next iteration. Why did this comment change? The earlier one sounds okay to me. 2. break; + case COPYSEQ_INSUFFICIENT_PERM: Why does this patch add additional new lines? We use both styles (existing and what this patch does) in the code but it seems unnecessary to change for this patch. 3. - ProcessSequencesForSync(); + + /* Check if sequence worker needs to be started */ + MaybeLaunchSequenceSyncWorker(); No need for an additional line and a comment here. --=20 With Regards, Amit Kapila.