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.94.2) (envelope-from ) id 1uSRv1-007epZ-JP for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jun 2025 02:55:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSRux-00GJ7u-MD for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jun 2025 02:55: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.94.2) (envelope-from ) id 1uSRux-00GJ7m-CT for pgsql-hackers@lists.postgresql.org; Fri, 20 Jun 2025 02:55:52 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uSRuv-0033QF-2h for pgsql-hackers@postgresql.org; Fri, 20 Jun 2025 02:55:51 +0000 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-3122368d7cfso842837a91.1 for ; Thu, 19 Jun 2025 19:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750388147; x=1750992947; 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=I3SKoOQvBEvckqHJoyFnjuk0DpfoHwtU05nYJ5XR63s=; b=Ct4g9oGVSZa3GAPWS4Co1M1i60vHC1XTanh/Dy/RTiiUGcQ2NT8NazERZfILUSonwI b6D1pdS0tJPEiHbYX0PPy6ggI+De4JN9U9gi6IN3hlxVlKORIpn/hw/EUVb4bWq/KBwy Yxa8gFkTj2wm751bHcKdrgPGJky8opb+hjAB3m2wAj+rk+mBC447ZweLtPPMrSt3sYVi y/JqZG7n40XHnnm4WDLx7ebtIbGZR3/zLsLvK/yWDyjmVFY3kJerrvOeij5+iMVYcBAI HRMll8qRlVcIeu1Kc1znDYinoNsVpvzfirvuLK/i5QIgCU6ioAvhRCOgMGIR/BgemO2P MdGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750388147; x=1750992947; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I3SKoOQvBEvckqHJoyFnjuk0DpfoHwtU05nYJ5XR63s=; b=JrxFk7cbO52HVn1WAm8UtaGfA4GREHRk4buTgbr9fQ+HyEhz/WlNE7T0pRoBJvFH51 sIxDjpKNga0tmqy3Q+KObqwu9XhIlnLjve3sujRAxr5rOV6O8nkIVeeT7zORasZJO+8L WL3dwYoGw6y/9eINQwRWdSd73oPrmqJjfgjzofSygLOuvPgfs+h9ISqYESfsY9svP+uQ Tf2XR31JCuPcL5bCWikg3nvpXN9NpB4Hgh3GPMpFSCz+IUVU3GlP8WXOmHhx/bgJiM4d PzXLCjfUmxC0m9OrM6m5824TfTiH5YANxU4zMgX3JNyjXTYRULcBcD+gW2UzIN+a+A55 gnwg== X-Forwarded-Encrypted: i=1; AJvYcCWlQ+7coXCg831xdfl7yyCUwO6HmC54kbaWA46O9S9zCzIryA8s2n07doGPgKxa83W4dYzT0ghzzJaETozU@postgresql.org X-Gm-Message-State: AOJu0YyIv4dafzg9v05oxVlixsuAhHrpisY+P0VArERl1S213+0liipe FIHHmNhwt0KWzAEtj3+LPLCHgtZUIF2W9D83NwYQSSyku5cX3Y+FYutH7qnDTxO6pBS6Y99Yux5 5UF0vPAATThl2IrnsyrgAzu+gFZfAFZY= X-Gm-Gg: ASbGncubDfDBueQ5Oj7HL3Cze1CmiTDnY7TirjWsqUKcUJ5IwYGHPhwF42oOlR8tPg4 A0n/h5p5CkSsbJJq1XbfTuuTQOR3RUDu6K0+3JgSRT43uiDPoGB1yIk1hcZqnE2ZdmOJlt6PPi7 fi6urDbXuZhTgmdD6liCGA8Agfiznm2osUvfllZq4WRm5Icg== X-Google-Smtp-Source: AGHT+IEUtI4qjoF7aH+5jCuMHdI4IxtqGsBMQFezZ5Mfp1KXAOsmuBTfQmRWPr2iMMpylDp/3yrtJ024262wsftLtUg= X-Received: by 2002:a17:90b:5826:b0:311:afd1:745b with SMTP id 98e67ed59e1d1-3159d64e390mr2416171a91.11.1750388146944; Thu, 19 Jun 2025 19:55:46 -0700 (PDT) MIME-Version: 1.0 References: <1d12d2-67235980-35-19a406a0@63439497> <1d97ec-6841b600-3-b7b4780@40747246> <28c8bf-68470780-3-51b29480@89454035> <0a617d34-abc3-4090-92a5-ea15d45e36f6@gmail.com> <228607.1750003556@sss.pgh.pa.us> <3f242e-68518380-11-78125f00@134027639> <214ba-6852df80-9-7e0df800@134698799> <21b44-6852e000-3-a556820@87831171> In-Reply-To: From: Amit Kapila Date: Fri, 20 Jun 2025 08:25:34 +0530 X-Gm-Features: AX0GCFs-oR9BVGZJqIWOLDnQ3Gzr_X7FSfoCY_TZKiKt6fH-Pqy3oWSYJ1KfRmk Message-ID: Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly To: Alexander Korotkov Cc: Vitaly Davydov , vignesh C , "Hayato Kuroda (Fujitsu)" , Tom Lane , Alexander Lakhin , pgsql-hackers , Masahiko Sawada , "tomas@vondra.me" 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, Jun 20, 2025 at 5:48=E2=80=AFAM Alexander Korotkov wrote: > > > > > If what I said above is correct, then the following part of the commit > > message will be incorrect: > > "As stated in the ReplicationSlotReserveWal() comment, this is not > > always true. Additionally, this issue has been spotted by some > > buildfarm > > members." > > I agree, this comment needs improvement in terms of clarity. > > Meanwhile I've pushed the patch for TAP tests, which I think didn't > get any objections. > Sounds reasonable. As per analysis till now, it seems removal of new assert is correct and we just need to figure out the reason in all failure cases as to why the physical slot's restart_lsn goes backward, and then add a comment somewhere to ensure that we don't repeat a similar mistake in the future. --=20 With Regards, Amit Kapila.