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 1wB3Jd-000gtl-01 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 04:17:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wB3Jb-009BUg-1A for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Apr 2026 04:17:56 +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.96) (envelope-from ) id 1wB3Jb-009BUV-0D for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 04:17:55 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wB3Ja-00000000IA5-0MUu for pgsql-hackers@lists.postgresql.org; Fri, 10 Apr 2026 04:17:55 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-38e12c67a6fso14523261fa.1 for ; Thu, 09 Apr 2026 21:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775794673; cv=none; d=google.com; s=arc-20240605; b=X9pXVuvT+IfeUPqa4RdOT7sGOvjm1IrCOByc80hAOZXONx0lNZ31A7mleVuFJTZbp9 epCxRVp/MrDPiOVtDuob/02pGpZbHnHgdMWoQrYCI9YFaDdVFR7rLDoMVRY+NHg0HMaY 7dvVRvYA28AlYzxQah2es5eTvXHl1Sdui47/d3HaAGMaPbgXxZBvcB3h3KVaWZBQibRc B4qFTZ4+Y2c2SqCsIvBed+CIsyrP9LM47pTKNmwDu1Cl9w11pa4XVJq6B6ZZJycEJxhQ IqbFDUj5EFtAgD7B7LvyuzX+ZygZBbXEua1NVBacvvHMZTjLeWBdEuYe4VEAxmuiMINA h/9w== 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=NBQ23ABsakrFIksR2Bu5R9RZrL6x8O83vmz07p100LA=; fh=bOOp6KkKdeil1FtxUEkBvnaQ01D6OhBOqAYLFvsP7Vo=; b=Mb0ecjWuF/Aj5ZUWJwMV2xZCVrhlWqvgfWIdYjAkbNxocJXPdMJKporI/s26DJmG7U nFip7uVroUNif5TlNEzuBdBzppxn0M/iVBGcxgegeCc+cXT/RyPsZARVVvcD3CvB9M3d WwoCUuEk21P9KE2W4aBCbpuGKCKhflFkH3k5c3lQgS6f/jduBxZJ5CUoCLTrwzO5fZUa h4TGZ7yLV7Nmk9TNM2TBnM2O6NEl2tcyYujXO4UACW8gK+HdcCkkP9hxCQ5pvbS3PaYr XBrQP3PaTpWYZ8luhEQQWtvKwCM07IKmDm5DglA4VXKxiufDXbb23lZ3vJInvBDgCzKw xh1g==; 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=20251104; t=1775794673; x=1776399473; 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=NBQ23ABsakrFIksR2Bu5R9RZrL6x8O83vmz07p100LA=; b=EDU5VKBwnF6/T8zXo3ob3yYezCL1E+wUSt1c7Ytvhjof6JkJO/CmzV9Lln3As/E1ST L8LcYNCyBDp/YYgTbAFXIccQG0kE+q6pqyXbvCzohYyDURNhr2U6MYVitCWCK2d4aGHQ JBP654j89xAjvOQsXyFB/d1Yax+hhGQDucsfPPQcXQYdxvzDYXMJ1BQV8kC8xB4al741 DqDrVKvTp0GKzsThzhvIhTlXfdkYVo89b56GRKatKlqpkl1ABvMnKTIOjGYYSNoqI3ts wLXN5OJpFeC0iyb7Cz4um5FLTf44ah0PH8tJggpVSO7pjuYQ5oA34FjuA+nulWs2jWs4 RKdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775794673; x=1776399473; 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=NBQ23ABsakrFIksR2Bu5R9RZrL6x8O83vmz07p100LA=; b=Q3g3w7HZkjaHBaMg8CA8vV3D5qs2MyZSfo4zwO7Ufzy11Uap6a4v7U2fRZK57/RtEA CEgMc+/AdynQjqcJR3RJLCXbZic3H9oJVwz7kBbCsxk0rIvWTnHzcMNNZSLUQW49N4er 5K/ZH/iZW5n5v7CZZKumHNpkrX6aR3LhljYjqtI9uzWwuPBTzzqJ2ypejUtFNe+sALsq H3lotj7C8riPkK4K+pYzeN3R0T0rO79UdNQsO6KbnUx+4zEvjyiHIMqP+f9VmS/mdiz1 4J5yXufT1MHTC0bKVUi1jnmGFi0kM+5gtgT/HyBakaEovlJyGK8tlrnEgOjMyJ257j9S kRqA== X-Gm-Message-State: AOJu0Yyoa4Ba/BN3quIytuws9psNhi5037iJjs8/65slVYIb49/qe3tT NiF8VenoTP1XFJlKdZzxA4i+j6x2YjgmGke4vW9juZqSadPBpOrgwA+OfFV3sdPZBTtjEcsvA9u d6o8tSBMsPl4QXfU58nT854R2ovT9drc= X-Gm-Gg: AeBDies7HwRcBpFhYFHcOpAEFv0+58wB3M+Vfx+4eaXAM9tSj1MS6PSOWwBLluTwclY FrFPbZbJUzLpGK3H0GXWhyl0UjC35dOgCaEtyD3gEismmBWH9juC4VLQHFQt2u6Imp9+HWG0n9e CDbF4rMm2ENEVuCUuYcXznYZMhvhzzs5MzU4S5zbujZh97AqzATTJ0KMaNaKHDgOsD2lH4kurZm L2NUj4hsYrLgdzXO0SaUm4Vn+sGMHhG7oMXrpgkGhwsFMhn1CDVTCYmqV/mHm7DTq3X90Oy25sE HcDqkubzdEEDL9I3SCErmC14Zz/sO5KV9F3NbEw2 X-Received: by 2002:a05:651c:2149:b0:38e:1714:b674 with SMTP id 38308e7fff4ca-38e4bf74131mr2346071fa.33.1775794672864; Thu, 09 Apr 2026 21:17:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Fri, 10 Apr 2026 09:47:40 +0530 X-Gm-Features: AQROBzDxcJOP-O40-1-hssEzKdkXLhzdvvBE7yRW_STtuvUfFe-tuSL5LBM9Ugs Message-ID: Subject: Re: Fix slotsync worker busy loop causing repeated log messages To: "Zhijie Hou (Fujitsu)" Cc: PostgreSQL Hackers , Fujii Masao 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 Fri, Apr 10, 2026 at 8:28=E2=80=AFAM Zhijie Hou (Fujitsu) wrote: > > On Sunday, March 22, 2026 1:47 AM Amit Kapila w= rote: > > > > * > > @@ -2174,7 +2193,10 @@ > > LogicalSlotAdvanceAndCheckSnapState(XLogRecPtr moveto, > > > > if (XLogRecPtrIsValid(ctx->reader->EndRecPtr)) > > { > > - LogicalConfirmReceivedLocation(moveto); > > + bool slot_updated =3D LogicalConfirmReceivedLocation(moveto); > > + > > + if (updated_xmin_or_lsn) > > + *updated_xmin_or_lsn =3D slot_updated; > > > > BTW, LogicalSlotAdvanceAndCheckSnapState() could also advance slot whil= e > > processing running_xact record, so not sure we can rely only on the exp= licit > > call LogicalConfirmReceivedLocation() above to ascertain the same. > > Perhaps we could simply compare the slot's old and new LSN/xmin to determ= ine > whether updated_xmin_or_lsn needs to be set. This would avoid the need to= hook > into each individual update path at the lower level. Attaching a patch fo= r reference. > Yes, this sounds like a good idea, I will review it further. > > > > Sorry, I couldn't get the chance to look at the patches proposed by Hou= -san to > > fix this issue but I'll look at it after the feature freeze. > > The other patches attempt to advance restart_lsn in more cases by modifyi= ng the > logical decoding logic. However, those scenarios are relatively rare and = may not > produce significant improvement outside the slot synchronization context.= So, I > think modifying the slot sync worker to correctly increase the polling in= terval instead > is also a good starting point. > Even in slot synchronization, this is a very rare case where the slot on primary is not continuously being advanced as normally we do via walsender, otherwise, we wouldn't have seen LOGs at this frequency. --=20 With Regards, Amit Kapila.