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 1uRpdo-00H0zL-CY for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Jun 2025 10:03:36 +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 1uRpdk-000LYm-Rr for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Jun 2025 10:03:33 +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 1uRpdk-000LYe-IJ for pgsql-hackers@lists.postgresql.org; Wed, 18 Jun 2025 10:03:33 +0000 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uRpdi-002kCy-32 for pgsql-hackers@postgresql.org; Wed, 18 Jun 2025 10:03:32 +0000 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e731a56e111so6131263276.1 for ; Wed, 18 Jun 2025 03:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750241009; x=1750845809; 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=OMvF+VUmqfLLu8krcPPsgV8K9I0rcn8fmbZkLfJiG+0=; b=UqTjfnctNAgc1237fdoGZnBVHBNKPuq+ZL08E/Jj2pLBDJio2IyTwt/w2P0tykwGqD XrDjdM5tNhF5z7rEvKbCBxSaxuEBcu6Iovi53auMqLql4fEpyYq4sOGeMxav7g4F+qHC d36KvxwGGv1K3lUdnIxmqy6oTkCVc1xaCEefJQtNwRNJNg0L5QiPH1xg/Ukr0KmMZV5C poub/sYBMmRyn53UpdzTed5LEgge4E9Pdw72G55pQnFEpvmx9PJzxnrvMNDu1vmK5TqN SLoYzpM4bJhQgUiLolNTcXu36QlO18G09rJ3YWTPKqpnjUXoJFh+F2EwBBYXZdnBUVuH ZM2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750241009; x=1750845809; 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=OMvF+VUmqfLLu8krcPPsgV8K9I0rcn8fmbZkLfJiG+0=; b=ZLAMMkygqec6h+H3LSTWJY6JScIOXogZiREKQyxDmQ4D/NnXwjTaOwq4uUTpr0np1e r/h4/57O8HR7IviMsuW120ZEIjs4WYrKaoJC2CWNNN2pPKWdDW+HvdFsFL7dv6SkvLxY lAcojbuDlH3lbfnhwzEl2XdbumBypxJeEIJ3+XAk2gc1ePj+94JPRWxzlo65UQgO6MlP ZfP020+ThfHTrl1zgAmYx3GiokPosBXpkYmR0JEwzCsbbKEgRbS50kpKNGmHlMKA9a6r 6VS10PyFnNzAqqmxt2FTtCm2bwPlS8DrpEfQqi2xI2jmrJuI0Vmcjm5FLG0rCZ7NAHAk Wiiw== X-Forwarded-Encrypted: i=1; AJvYcCVUUyAVAfg6V1earRTqnF/t42ctiSmbs5JGe+Y+rbzv0TFIcNNCr9hNcV8RA497SToF4++jXC590Eu1QgQb@postgresql.org X-Gm-Message-State: AOJu0Yximr1RflpindqXF0ei6jcXjBe7vozLTQwlRPrXeiQXaNnJXKYZ BuERbA8XwJsoBHdjqeDxJj2AFzN1SOKo8iR8w34eif2n6IFLmbKloU36/3DoXnOae9aOTUkp+rl P0gIgVwBMAzz4lKoBc2EwcUutYtmM6uk= X-Gm-Gg: ASbGncsrQ43y52IMCv2LzkanU6L3IlBnZsWVfwf7o2QTiD/O9LmtzQaU4A2PiwIu+Cl 2nd8cP3y5x04aKPcsfGa68LGnhx8Slkybo/DZMzGVCy7mkn1tfiQMCXLbavUm32tyb2zbTS6DAL PRrYMwp2pEByhPz7DjVuO+eK/OIliF31JeTbnZtnjXjaveXg== X-Google-Smtp-Source: AGHT+IFASn+aGrz78x110+mE/wxiSz9lamexQCPMVf/vZXLU+7F+dP+yGqVIOHa0Saj5jIeOmDXyJBzO3+W1xXaRQLE= X-Received: by 2002:a05:6902:2b8d:b0:e82:64c8:6b88 with SMTP id 3f1490d57ef6-e8264c86c32mr10841453276.44.1750241009365; Wed, 18 Jun 2025 03:03:29 -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> <14841-68528100-1f-5d76c480@266989578> In-Reply-To: <14841-68528100-1f-5d76c480@266989578> From: vignesh C Date: Wed, 18 Jun 2025 15:33:17 +0530 X-Gm-Features: AX0GCFvPcMaOXy4zX1E9BHhcT7B53Dhc8miIWEgp299-f19i1xBooaYgvKpjvXo Message-ID: Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly To: Vitaly Davydov Cc: "Hayato Kuroda (Fujitsu)" , Alexander Korotkov , Tom Lane , Alexander Lakhin , Amit Kapila , 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, 18 Jun 2025 at 14:35, Vitaly Davydov wro= te: > > Dear Hayato, > > > To confirm, can you tell me the theory why the walsender received old L= SN? > > It is sent by the walreceiver, so is there a case that LogstreamResult.= Flush can go backward? > > Not sure we can accept the situation. > > I can't say anything about the origin of the issue, but it can be easily = reproduced > on the master branch: > > 1. Add an assert in PhysicalConfirmReceivedLocation (apply the attached p= atch) > 2. Compile & install with tap tests and assertions enabled > 3. cd src/bin/pg_basebackup/ > 3. PROVE_TESTS=3Dt/020_pg_receivewal.pl gmake check Thanks for the steps, I was able to reproduce the issue with the suggested steps. > The test will fail because of the assertion. I plan to investigate the is= sue > but I need some more time for it. Once, it happens on the original master > branch, I think, this problem already exists. The proposed patch seems > to be not guilty. This issue occurs even prior to this commit, I was able to reproduce it on a version just before it. I=E2=80=99ll also look into analyzing the r= oot cause further. > It may be the same problem as discussed in: > https://www.postgresql.org/message-id/CALDaNm2uQbhEVJzvnja6rw7Q9AYu9FpVmE= T%3DTbwLjV3DcPRhLw%40mail.gmail.com This issue was related to confirmed_flush and was addressed in commit d1ffcc7fa3c54de8b2a677a3e503fc808c7b419c. It is not related to restart_lsn. Regards, Vignesh