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 1wXqD6-003Vn1-2h for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jun 2026 00:57:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXqD5-00HXcR-2C for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jun 2026 00:57:23 +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 1wXqD5-00HXcI-1F for pgsql-hackers@lists.postgresql.org; Fri, 12 Jun 2026 00:57:23 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXqD3-00000002djj-0EOr for pgsql-hackers@postgresql.org; Fri, 12 Jun 2026 00:57:22 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-68c3421b009so2358547a12.1 for ; Thu, 11 Jun 2026 17:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781225839; cv=none; d=google.com; s=arc-20240605; b=fF6NKbMUMpSjRXlcSPe3OBMiFF8nsHNB8MsSyCk++haZ1VP+QdLfVAN+nRlp+Uqvkl y+ftIew/Uq1pFEa1/Lu9hxnNQCG8rhPXWgz5bA8Nch8vhhTpDxqhVKlSK6atmOL2dGbe gxZUL3zmUlbRsKiWrKAFhVo4kSIljQ16yu1YdxTe5L5ncV6gLZ9DN2AjmO4HSLUcbi2Q zuJ6dm6mc5Mdv1whhY6gNL5JGfT9e5iAcdMiNYvL6GJIU67oQAaVCGG2lkSLW9p2NMW6 Nnv0qoN2Et5+dmgEDGbmYUeNTTx7U3dGdipQVN6dpef0SMHj7FWVLvCb2t59Vsu1azlQ SN/Q== 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=dkx8TqKohXAxvYgB1uHPo+5He/a09cOXrlU5URsq7Cc=; fh=Bo6OyZnSG+Izrcypfo4s0J5KAC0qQiIg0aIzYxl00+k=; b=KbGUK8ToTFRgpg2aTfLCzKYNHajmM4dyJrGrvWd6dgqmAZM+YRVPP47fL2dj+QYW2x jz376lCcgHJF6byUy4r8+DSD+f2E7jpzhvzLk1D00IclYupEkR5wW6d+CdFhUmV7MBke Sfp8UKui9PakCTkk0bv324ahbr7fyQE7+nzoUYL8zZkBMA/mM/QJRigaIlEKXoeiQ8et Zq8K8jZ1RQETTpDQvbtvfJl5Kz9ZcXg1WCuoKu82bdXTK9aWR0qlrfE+/et9SbDSdZ6E Nyj4FSqtNqs6Yv9SVNrVv2Fbbrgq2gPVJxx4XtFt44Lk4foLoYyAy3ZqDJTU5fhzGvwB 7k3A==; darn=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=1781225839; x=1781830639; darn=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=dkx8TqKohXAxvYgB1uHPo+5He/a09cOXrlU5URsq7Cc=; b=AA4YXHcWBnZmW06A0AeBliNlEgily7ZT0dITlX8zaGUshAzo7gY7Il0C4z98xIQast QMJKRC+PLjgsYg/z9fzMpto6VORtjLdAtDldj7FoQbgZnjjupHZS7umCfQa288kOl2JB RIxBs0bNHAKzk6j7i1OxDWylPeTUX0iJuq4FY6NvAel3tE2LYVgqIpJR9UwqtC56xzXR 9UHYlcyz4wUsQ7qMRutwLDkV2ZIjBfqEso5VSxUNAZpeHWng1hY4h81h0UMqbNnOwUNA AwNlH7DxXqm6YOFVAitmugyMnrlD9bBm8xrt15UYKiop/RUv2SbhLpU4CiwyqNBE3WvR dNJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781225839; x=1781830639; 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=dkx8TqKohXAxvYgB1uHPo+5He/a09cOXrlU5URsq7Cc=; b=c8J17mxCpkcQyDw9/gEAWFFDOncUS9ABHi1M4Ef0f2zmtHjTJP20JvM+e5LiTwM/HU zhtBJpUnTtLR57AnIrWJOxvcJgHx6bcFXt58zBLl1fRTVcdAvwdM+VBFD0UI0Upt1JAr S4amfVkAR4jQk4h9JfllMqy9WNrPRI5h2+VkqQbKc4LOLe57LsAXcK8fgykqy0OzHna2 ZOA4Pb/X5WLmHbJtxm5AYb6quOTF4E7CAdA+HEcWXm/8FHL0MxlwJXyEE6YanUcrlOVq u9YvO2brtwiZajKZN2LWb4e/ZVpOzCT/7GpaqvxwKrDfigXoktZiEEHWOYn9MLVDi13W 2hNA== X-Forwarded-Encrypted: i=1; AFNElJ+mdKR25N+b0y1emuGN4+82mz1YCAC1buMOYBvgJklbbuvRonCxhFC9k3nlMjH85xBt0vTx+8Gs8emfCH+x@postgresql.org X-Gm-Message-State: AOJu0Yy8XvwJCaLRp55m+d/DLtXQ/j/8EATTppQRKSC6jFLwwiWcsEN1 +STlNgdLvlrypl7+QOWNgEaNr3B+tK3WQ/bfyeF8GcnGbN3JOXaCz7s7rE7To7PDoyOIc4N+lJH AefYVHVJnlnjXgvmCJAQVJZs9nXLNYIs= X-Gm-Gg: Acq92OGF6EcEakMBLpJs5g/HxLGO1HT1tggw844UXCwwtmbBZuwiY191WGa73abYlr0 PxcA1okQbiSQwtuwOCZDSlrRKTFAbOKBoqSVFNd10f54did3Mj/keid0faoMD0TQn0HPvhIYwQc fVXfNNEw5mum6IeUJQLwdGQPTsCpxLP6unsvBmiDwnb6JR1JBrQrmDIseGKs49haXtSTGJffLsT h93+tyX4zDS9HQ+XNcDPEk1UwQUdWnmc0+KfL+lZV/GwRgtzlyiPygSQi+gIxqrvzLZqQLxisjB 3O981VOMLmbFPderd7iB4xRBh5wzmCs8OMkgoI/Yut2GPNk3d8LcZP0xBIrHH5jQFFdbaq3pTbk NWDDjzBBWZ6cA3wI= X-Received: by 2002:a17:907:1c29:b0:bec:1632:ece8 with SMTP id a640c23a62f3a-bfde4c0136fmr36089766b.15.1781225838437; Thu, 11 Jun 2026 17:57:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Xuneng Zhou Date: Fri, 12 Jun 2026 08:57:05 +0800 X-Gm-Features: AVVi8CdkvJKMEEYVtghO94R1IfUSN0k6LKkfFYiUHk_BXY4MQmfrAZsPn6t1CS4 Message-ID: Subject: Re: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline To: Michael Paquier Cc: Bertrand Drouvot , "Hayato Kuroda (Fujitsu)" , Alexander Lakhin , pgsql-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 Hi Michael, On Thu, Jun 11, 2026 at 9:15=E2=80=AFAM Michael Paquier wrote: > > On Wed, Jun 10, 2026 at 05:28:00PM +0000, Bertrand Drouvot wrote: > > On Wed, Jun 10, 2026 at 04:36:14PM +0800, Xuneng Zhou wrote: > >> The > >> essential thing is just to ensure that the startup remains paused > >> until decoding output is observed. > > > > Right, thanks for confirming. That's exactly what v2 is doing. > > I have looked at this thread, and my first impression was that this > could be a data integrity issue while decoding changes due to the > transient errors one could see across the promotion requests. > > But it's less severe than I thought initially: we have an availability > problem here, down to v16, with a correct recovery possible once the > promotion request has completed. That could be indeed surprising for > users that have HA setups with standbys doing logical decoding.. The > SQL function path is less worrying to me, there are as far as I know > few users of it compared to the "native" path with sync workers. > > read_local_xlog_page_guts() does not only impact SQL-callable logirep > functions, even it is the spot that should be hit most of the time > (again, the RecoveryInProgress() vs promotion window is super narrow). > At quick glance, things are: > - walinspect. > - Slot advance. > - Slot creation (?), but it feels even narrower. Yeah, it is used for two-phase commit as well. The usage of it is broader than I observed before. Repack worker also make use of it. > With two items dealt with on this thread for these two callback paths > changed, moving on the part related to physical replication into its > own thread would be better. This requires an entirely different > analysis and a different lookup. +1 > The backpatch of PG16 is straight-forward and adding > GetWALInsertionTimeLineIfSet() down there does not look like an issue. > Not having any tests in v16 feels sad, but that's life. It does not > prevent addressing the availability issue on this branch. > > I'll go take it up from here. > -- Thanks for dealing with this! --=20 Regards, Xuneng Zhou HighGo Software Co., Ltd.