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 1uciYj-00G8DF-HO for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jul 2025 10:43:21 +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 1uciYh-00AixA-Jr for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jul 2025 10:43:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uciYh-00Aiwj-AD for pgsql-hackers@lists.postgresql.org; Fri, 18 Jul 2025 10:43:19 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uciYf-007vM8-2W for pgsql-hackers@postgresql.org; Fri, 18 Jul 2025 10:43:19 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-873501d2ca1so44687239f.2 for ; Fri, 18 Jul 2025 03:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752835397; x=1753440197; 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=SocN2X/T2znNmmLmQGQILqFkfvViJyJDY4vQVw8biIM=; b=Y/oZttMpzOA5a80gRhCgcB4nizcjbODw+uYvAqfz0yKUrxF+tj/u4i/F7JKaYmIL9A 3ykJwqTxSTD2EuPIyHs9DwJRPIKcMKtOt/CmhMWI0QfYXPMb3gDnuVPzgPClpGZE8dGY cDYrhEKHLPdD0jFFxjmnD4Z+BV8pF6KldvKeBm9U2cEH6LMjKGXjF3+UiacAqecGoyFA cb9lFxAcGQl/zul2Rxj/becpXJbBpqhKdLc1hKmfsLa3nK3Sq4nA4mjJfNM9FfcvBXwg y9t6do82Fl+3RHh99gozrSNhLaqjH0mxtJi/yGEvWmoraaZYMUM6fM7zmFjqogqvtVm9 RxCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752835397; x=1753440197; 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=SocN2X/T2znNmmLmQGQILqFkfvViJyJDY4vQVw8biIM=; b=UB7RshzIL4VSTkCDWjs9Enl9vvgZTEL3ECzX8odK38nrRcd/wteHdJAtsr2UmXSCBD uUhz+P/12y14qQYnn8I+akboNhOmEDM4mrNbr6pjkm+ZlG4E8ZMQATYEP7mIE1gOaSWt nQAzowVMEiLbardkp2605lTkRqtrCBBoRaFaIBg5kNVZ5qWsMy4ELU1pivFGLcul40J/ f0c/PfyOU7ODwtgt0RlzqGemSiOOWqhJfguaQhS9UK+eNOCZG5ywRsd83yip+DLVsk6f IhWJFlDBZcPm5QZ/+1twbBTAQh28YI8LsV323hMjtGIgM0w06jYH5+8g5Af6XhBHvk16 Y3Pg== X-Forwarded-Encrypted: i=1; AJvYcCWL/o+LfkxGh5c7K9eL9K0YqvzfhJeVsUfmLuSnHe4TrM/KhNjdzNOdhvPBz8FRle3UylqEcIbVdyjPj58/@postgresql.org X-Gm-Message-State: AOJu0YxBbTzWZB/ySLmbdaeNSt+aEd2itXLtbAWRqTnJdu66eSXZ8hwx OLnA8MQdufMl9Ztiqpc/8MMuu+U1wZz/GDLmaubmNS6+969oZhUxYVpXVoZIkpcuSFGbY1+oFYU Z849kO2+lIaitgT0k79W2v1bqtyD2S7o= X-Gm-Gg: ASbGnctfQ56ueZNwGvELVPd58nfz+ZaHlfK3FNwLaobRxFIf89Aa4Ogn6AwdkCee+BH 92H0lSeYta+2EXx5phgIGF/QVmq6hYJywx/i2/9nxURbm7iHuaXpjtc+7cnWeVcJcrMUidZIH2q 6Et/miIixlUffnM8b3hKKPk/y6Zn8uoFsidxij/wLQVEXceoYqcbdJbBioUCQW0wTsDUjyn8ckE G+7e3o= X-Google-Smtp-Source: AGHT+IF7sDS8a11GU819o+9EbzStQcFyi2dsy4hWpVIg9c3LPfmfUGeJjqkOlZDG3SRohZ8OjIh9oq46b2wMMf+zanI= X-Received: by 2002:a05:6e02:16cc:b0:3df:2a58:381a with SMTP id e9e14a558f8ab-3e282d8f304mr105219535ab.3.1752835396881; Fri, 18 Jul 2025 03:43:16 -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 13:43:04 +0300 X-Gm-Features: Ac12FXyhsNheclszPzTzUww4EgL0uhB62EhBK8YzBoEAS1nugAb0185WFBlDFqA Message-ID: Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly To: vignesh C Cc: "Hayato Kuroda (Fujitsu)" , Amit Kapila , Vitaly Davydov , 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 Wed, Jul 2, 2025 at 8:20=E2=80=AFPM vignesh C wrot= e: > On Sun, 29 Jun 2025 at 11:52, Hayato Kuroda (Fujitsu) > wrote: > > > > Dear hackers, > > > > Thanks everyone who are working on the bug. IIUC the remained task is > > to add code comments for avoiding the same mistake again described here= : > > > > > 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. > > > > I've wrote a draft for that. How do you think? > > I analyzed a scenario involving physical replication where the > restart_lsn appears to go backward by fewer files: This is indeed an interesting case. But does restart_lsn go so much backwards in this case? I've checked the logs. It looks like standby requested a position several segments back, but restart_lsn keeps increasing. > I'm ok with adding the comments. Thank you for your feedback! ------ Regards, Alexander Korotkov Supabase