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.98.2) (envelope-from ) id 1xInkP-00000003txx-2sdc for pgsql-general@arkaria.postgresql.org; Mon, 19 Oct 2026 13:49:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xInkO-00000007OOW-2WDU for pgsql-general@arkaria.postgresql.org; Mon, 19 Oct 2026 13:49:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xInkO-00000007OOO-11xe for pgsql-general@lists.postgresql.org; Mon, 19 Oct 2026 13:49:52 +0000 Received: from mail-dy1-x132d.google.com ([2607:f8b0:4864:20::132d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xInkM-00000002zEK-0Jwh for pgsql-general@lists.postgresql.org; Mon, 19 Oct 2026 13:49:51 +0000 Received: by mail-dy1-x132d.google.com with SMTP id 5a478bee46e88-35ca5244753so242066eec.2 for ; Mon, 19 Oct 2026 06:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792417788; x=1793022588; darn=lists.postgresql.org; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=pYmE4evGVO6lpzv6N639CsRmtuHMN/3R0uQevDXbQCk=; b=BHFx8NrjrMCEYCovPveZdwxybIN88VnRbAHVNB4ppJFKGRfSL2AfM+Ev1CH6TWNHBN ZpUw2J26gH/UPE/x7vOQqNtD2woQeRPly857HrPeOhEI8QgNNurqs9541jsEmT/gdDcV n9ADolfAxNH9rTaGMY/GzMclQhsA8aJpgSOqB8T7I/eq9+cmGUrKJTpNi1VzsKSI3jrn 1vyGoDQA9+QWSC+h1kcsL33LNFNTJYzLIUQw7U0NHIRq/bj09gBGnGdSzky7ZGRUexah c8Jw8qpxgYyi6X6GzgRrks1wvDOHrIy5/3p7fH3qN1NvLEwtGbY1Jj6Q+PVrcM1sO4w1 CGoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792417788; x=1793022588; h=mime-version:content-transfer-encoding:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=pYmE4evGVO6lpzv6N639CsRmtuHMN/3R0uQevDXbQCk=; b=JFswjJlNR2r2xgSInqqk5vomGEpbSEhXyaaFu56TK8cF8Atvs6cXMxrPhsqiussktg 8GKYbjIRoAVnffP3xKR3S31BJ70ceingIWDj9M4GAWAKFEEf0z0jAGuIHw2Ki0fLhrkl BsYsJm+GHFuZsKsbdPcpBCh6fBadS6mtD+txNhab5A/cY19V9zEv1CNtkjZD5o/1uVbM KlQqhlnZth6gq+QNHoi56dnlbM6QTxuIjbuA05qROoVsTl4Y6I1ptBWfhLNZqj5GKJll wK0y646vleuGFgnJ8QG4zZ5JNxuwLQPglw8W+57fDZrv3O1+tvtdwR+6nV1oXZQfgbOr aNgw== X-Gm-Message-State: AFq9FYK5IX3kuPEnurqrCpxZDoq2NTqulkrEtb2q/p1IIWXd/BvJ0PgF 9/jip/TWkCf5E57GNkcqN4JNnX6j9cqTmvRCYaTSt/VY3A2jBnYeBEt0 X-Gm-Gg: AYBFou2i7+/H4YJnL5CxZkccJSzbLApBOF+D9oZNXKcRaIHi/Ahq45DOVtaMPuhxbxI 5VuI1hBRowgGi8128EPo/MtYWWloQAqmAQZs+yekP5vIijxhOqoyxRLiPwpNACfDQ+nP8BdO5L9 ejjlV3ch19S6ZgvBWP6QpHPrDJKgXLpZECtIIZoEGwfHfgp+M7ahZuKwnUABeAF380bpziQcSAq mLKHEvvrFg3Ot7OigAHbLITlFbrh6/SiIiF9IeZnbrYbn1Z9UWHPi5/Xpd19zwzlTMdGj4fJGGa Ckhz5q3mdrvwblVXGNmA5Oq+6k2mamxC2CYw22HfNJSE7uOw9Hu/M4EgcIhpwhdVaEA/+LDNsqX TeZcj412Fcdx5KGYFdmcqlh/URNgrbqyrZKKKfmCNQOwLqY4KVbVjQqJaBIX/F/9f0qgo7LlK/a OQ93SFRRgINMu3ZzYAh9AWiMkq+ICV//OqAEy1AOHhDUPeD0nTczp8czRI+nUDm2euxHAtIkfuf VdXWTPg7qlTNxFI4qYu11cZWSj/eOqqjgnAchAxNn8Ny/jtnvNfEDL+eeddWlSKR4F8iOAxnJ60 rexzInjLiyK1A1Q1FUMiyLp9Brj82zpOdQ== X-Received: by 2002:a05:7023:a5c:10b0:183:d275:cf76 with SMTP id a92af1059eb24-18511adbd46mr17485181c88.2.1792417787589; Mon, 19 Oct 2026 06:49:47 -0700 (PDT) Received: from 192.168.1.8 ([2803:3c90:cee:ea00:5c3c:7e70:29e3:7a55]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-18314ef8ed8sm27750886c88.3.2026.10.19.06.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2026 06:49:47 -0700 (PDT) From: Manu To: Durgamahesh Manne Cc: pgsql-general , Laurenz Albe , Adrian Klaver Subject: Re: Regarding huge logical slot lag between source and target Date: Mon, 19 Oct 2026 10:49:42 -0300 Message-ID: <179241778241.500292.2129909254871640315@gmail.com> In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Durga, > Now slot lag is very minimal. > How did you rectify when same issue you faced rather than resync data > from scratch. Glad it is minimal now. To be clear, I did not hit this on a production system -- I reproduced the pattern in a lab to find the cause, so there was nothing to "rectify" there. But that is the useful part: this kind of lag is a throughput deficit, not corruption. The slot's restart_lsn is simply trailing confirmed_flush, so it drains on its own once the subscriber catches up -- when the write load eases or the bottleneck is removed. A resync only buys you anything when there is real divergence on the subscriber, which this is not; it just resets the clock and the lag comes back under the same load. So if it grows again, the order is: find the bottleneck first (top on the walsender on the source and on the apply worker on the target -- whichever is near 100% of a core is the limit), then apply the matching lever: lower the commit rate reaching the hot table, split the tables across several subscriptions so more apply workers run in parallel, or give the subscriber more CPU/IO. No resync needed. Regards, Manu