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 1ucjTL-00GMUu-AG for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jul 2025 11:41:51 +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 1ucjTJ-00BTtS-0B for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jul 2025 11:41:49 +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 1ucjTI-00BTtK-Me for pgsql-hackers@lists.postgresql.org; Fri, 18 Jul 2025 11:41:49 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ucjTH-008QpD-05 for pgsql-hackers@postgresql.org; Fri, 18 Jul 2025 11:41:49 +0000 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3ddda0a8ba2so14436515ab.0 for ; Fri, 18 Jul 2025 04:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752838904; x=1753443704; 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=31cXKO6ZLwSmbYu8rDKxGnCJO74PYACtPyC0SdH49/0=; b=hB0kZ6ZOMcAsjnaj+u1mSoMO2bOZpGLs1lMDfIEE98nHw1+p9R8Uptfq3YiPtQvVmk yGWD5dcus8DmZg4cdEekCq41eAhxlqXV+LHSSAjh2FRTugViB06M4HPDY73/dD/iDYIU 1/idejEzfiNncO1iLxEti0m1/TzOfa7WEFY97jUJcXLt8xRWEQyrq/FSQ7P18kf47dLj n65376W7joEYbK52cW96rwdf4l9r6NCI7VymZGbmR8WcPyeWw0HfcU669hqJZ2o7RJHm GRjHMbHPC0bgebEGqCLP/cFZXC7wLCAutWSgFcuER28WvXcdcc1fly/UJyl0Spi4X8fC VeVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752838904; x=1753443704; 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=31cXKO6ZLwSmbYu8rDKxGnCJO74PYACtPyC0SdH49/0=; b=DZxC/ZYR1iPeh9yRUS3NmzvNTO0DAIjez/4Ar4tT1+rpI4/UVOGiu48OP8wgmY84+/ AxChyEmVaMQxif/BS64/FXTtQ3oo7+tDGYxbvnApxSpIHhkjQ6F5+xnogbjETtZSIHd7 MllrvbIfQD8IcWkidm2g0TpBDQBn2wehvhSkjkuaRrrcNBGSMUwf1/jfvK/meq9jrXYc vI1D+rzj/gKEKXkNvefsFNi5AFvyV+HanZRO2U/Xpg0nO/2yNypi/pjI88clAx41WJ42 pN8qYhRIkzq+3StwKnOIbxpTfdlmRxxj/d/fzZD3h+R9mdiEdthhx6GVqNTcv3PvDp1S kx5A== X-Forwarded-Encrypted: i=1; AJvYcCXc4dst/ucGcI0B3S/A9WZ3TSH6ZVkpDh+fB18i/ppbHmZuo+U2/N9nBclUYDU3NzWatl4NLylLJQxt+82L@postgresql.org X-Gm-Message-State: AOJu0YyrG0frMVSWqa96K3yA5sQPysbcIUh8mqs2Ae3/XWPbpaNH3gui l//B+G4Q7dHsCByxvl4gS6OsNmaMFtrkZK2+t1Eoe/DGsRnhs02gKwvbaBr6gpjQov2ah/yqjQ0 b4r4rZqxjkdDO8C9xRN77dCuphYLkWLY= X-Gm-Gg: ASbGnct/eMf++YptlQWcdep1zQS3vN8Px0fcyHUeNQzDATYlAwInBNT8D4HLC+/i3rM Gc+tT0E6eGxhR5bR+PXyaTXWEGCVc/YTWdKP71mSi/EWvoTwol89nPIGL7JFZ2nFhf+v+EJm+Ym kCOtyMOTX0tGKgLgPXL8liLIrEWTkCkTQVmjkQxXC+S+k9Ps4WRjNqw4h3t+0ULhk9HJyddEA5x UwLCO0= X-Google-Smtp-Source: AGHT+IHSBT1KyoMtWjZSepq+7NQ48GcMfumfCWq9msid62+ZvsQV+Jdv/WBr6R/Rm6o3ZVi6YUeMII0a8Xr9WE3JmsI= X-Received: by 2002:a05:6e02:74a:b0:3dd:c04e:49af with SMTP id e9e14a558f8ab-3e2823a5ed5mr128873955ab.3.1752838904144; Fri, 18 Jul 2025 04:41:44 -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: Alexander Korotkov Date: Fri, 18 Jul 2025 14:41:31 +0300 X-Gm-Features: Ac12FXxFqGYwkByum7veD6wZ_CaBnJaDSzLNLI8naRVWFOmt-xvH-XRCZiNoxzQ Message-ID: Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly To: Amit Kapila Cc: "Hayato Kuroda (Fujitsu)" , Vitaly Davydov , vignesh C , 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, Jul 18, 2025 at 1:48=E2=80=AFPM Amit Kapila wrote: > On Fri, Jul 18, 2025 at 4:15=E2=80=AFPM Alexander Korotkov wrote: > > > > On Sun, Jun 29, 2025 at 9:22=E2=80=AFAM Hayato Kuroda (Fujitsu) > > wrote: > > > Thanks everyone who are working on the bug. IIUC the remained task is > > > to add code comments for avoiding the same mistake again described he= re: > > > > > > > Sounds reasonable. As per analysis till now, it seems removal of ne= w > > > > 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 backwa= rd, > > > > and then add a comment somewhere to ensure that we don't repeat a > > > > similar mistake in the future. > > > > > > I've wrote a draft for that. How do you think? > > > > Looks good to me. I'm going to push this if no objections. > > > > As discussed earlier, it is a good idea to add comments in this area. > But as this is for pre-existing cases, won't it be better to start a > new thread explaining the cases and a patch? We may get feedback from > others as well. OK, done. https://www.postgresql.org/message-id/CAPpHfdvuyMrUg0Vs5jPfwLOo1M9B-GP5j_My= 9URnBX0B%3DnrHKw%40mail.gmail.com ------ Regards, Alexander Korotkov Supabase