Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQiRN-0005mR-7t for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2020 02:15:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQiRL-0007Rd-O5 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2020 02:15:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQiRL-0007RT-Hd for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2020 02:15:11 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQiRI-0006kW-J6 for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2020 02:15:10 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A72105C0191; Mon, 20 Apr 2020 22:15:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 20 Apr 2020 22:15:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=/gFpTFDSMkqwKhTQa/1JLqmsA6w Zpl5z0EEZXj5Vbqk=; b=L+Q3i8eU5rFxRzYH3cAG4YtV0VKSdHjdrhoHqHNpOPB SZ+uvNE7pd1YhJx/wj2NhzI/moBYZsosWLm92Q9lY8aYZMSdwGXSw8VUHOec4X2p gbbw5N0/dynabdit43klQLkSXkqaq0W2OvOstD8QfNE0pNIAX04BejCTcMz5vJS8 qoLPX1xKClqW+mNLgeGBv4OKXgXJpK5K3x1LZHI3AispfQ+Jr6lJkKhK6IqXzBBZ LZrhcJ6AQcZgaBJYGFu5OTHPLyomKHVRcpnN6dIHvBe41/uN6QC6B7TrigfwF1uo 4jx0R+54yd22/Y6yJ1WHj+582iL8Qv633skeeLKxv3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=/gFpTF DSMkqwKhTQa/1JLqmsA6wZpl5z0EEZXj5Vbqk=; b=U5KYtiLZAypn3Oo5YM2C6R 69rLL7RUqDFyitauAK1ntubeX6JsVVEfba9TibhlXGAl4enFdtfj1EyjfcWh9z3e H98+6dW9kKcyF3NZomMqHF7TLhoTjCqVhNJuN0HOhgjXYMkDXVxnH47BsbyEeVIh xcMuniOITrGb4pgNxaG/IeXIDqgE58lSIIqM8RdpLOYatK9jnRzCOUClSm9zEl04 2bDPri8uKsXrFwInztNRYN+3rkvOF/0cuxHOxXurwb1DMaTmwjoU8mkeUfH0CGlK TApiMScB7xsrtdcbc5M7IsBCNW9br57PC355pPoypT/cj8J92Nojv2UXhzbJ492g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrgeeggdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf fukfhfgggtuggjsehgtderredttddunecuhfhrohhmpefoihgthhgrvghlucfrrghquhhi vghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecukfhppeduudekrddvge durddvhedtrdekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (mp76f1fa54.ap.nuro.jp [118.241.250.84]) by mail.messagingengine.com (Postfix) with ESMTPA id 692C33280060; Mon, 20 Apr 2020 22:15:05 -0400 (EDT) Date: Tue, 21 Apr 2020 11:15:01 +0900 From: Michael Paquier To: Jehan-Guillaume de Rorthais Cc: Kyotaro Horiguchi , masao.fujii@oss.nttdata.com, pgsql-bugs@lists.postgresql.org Subject: Re: [BUG] non archived WAL removed during production crash recovery Message-ID: <20200421021501.GE77439@paquier.xyz> References: <20200417065043.GC350229@paquier.xyz> <20200417153304.01a226cc@firost> <20200418092611.GD350229@paquier.xyz> <20200420.160231.719176619682386260.horikyota.ntt@gmail.com> <20200420073444.GA77439@paquier.xyz> <20200420142235.1536a73b@firost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XRI2XbIfl/05pQwm" Content-Disposition: inline In-Reply-To: <20200420142235.1536a73b@firost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --XRI2XbIfl/05pQwm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 20, 2020 at 02:22:35PM +0200, Jehan-Guillaume de Rorthais wrote: > The problem is that we would have to read the controldata file each time = we > wonder if a segment should be archived/removed. Moreover, the controldata > file might not be in sync quickly enough with the real state for some oth= er > code path or futur needs. I don't think that this is what Horiguchi-san meant here. What I got =66rom his previous message would be to be to copy the shared value from the control file when necessary, and have the shared state use only a subset of the existing values of DBState, aka: - DB_IN_CRASH_RECOVERY - DB_IN_ARCHIVE_RECOVERY - DB_IN_PRODUCTION Still, that sounds wrong to me because then somebody would be tempted to change the shared value thinking that things like DB_SHUTDOWNING, DB_SHUTDOWNED_* or DB_STARTUP are valid but we don't want that here. Note that there may be a case for DB_STARTUP to be used in XLOGShmemInit(), but I'd rather let the code use the safest default, DB_IN_CRASH_RECOVERY to control that we won't remove .ready files by default until the startup process sees fit to do the actual switch depending on the checkpoint record lookup, if archive recovery was actually requested, etc. > Indeed, Beno=EEt Lobr=E9au reported this behavior to me. Noted. Thanks for the information. I don't think that I have ever met Beno=EEt in person, do I? Tell him that I owe him one beer or a beverage of his choice when we meet IRL, and that he had better use this message-id to make me keep my promise :) -- Michael --XRI2XbIfl/05pQwm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl6eVyUACgkQnvQgOdby QH1Ulw/8DdCahK7Ihv5VyG2WDienBRsOYde2vn6dCkMpuQ8ATB8kt7QtxHrJU+tW cEDyBjBfSvw2q6gWzu1LyfZNETVYc2otwfl7QDNyCybPInDl38MPT18qQfncNzrF koyx1i3rQWahTULCblUYQMoeQaMd1kQsRolH93OwpNo6jtyfoQ2MG4QpoVvdiJ+t hCrE9Ws9JVWdIUygETYlOS+B8PjWI7G+AJVk3Xet6kQqfXxGgSXhPZlC9b/UCCet p0GPETMoc6RLFx1pwtHO4wToBCg2uYoTtKJRBm8sHtYLKAfGaJvQex1nrzHUfVIJ Audm9RRS2m8zqHdBQ/sEjcPXSjBo6QONP8EwSE5PxMA3UVigC/M8O6qSPsVFjIZG 58TAJ1cIqMVBm346iFQY57mkmmWFSjEnnQ5dHu/cWC3dkHWvQz48+a6cSW/vy7UD EFuc1a/aNSj0SbSbAVME2Ee4Bd8tQw1P0q6HK1mFAqYfsRiHroCByEMtapIBh2CU HRyHCzf+QaMImLR5DlPkjpOu9wsfm/YvVg/6mTiZu4cbWXBjTJgSyzKh4/NB7EG6 t3BsJZNQQF6mNgv2ctH9tkL0WU/CbZP19cFero+EHCEl4j/O4sPfwW1M/HNaozKh n9xd52k9ZbZwRHy8dMEqFnYAw/BSXM1EGIQNaFnsfPDCBDHTOYs= =j8KQ -----END PGP SIGNATURE----- --XRI2XbIfl/05pQwm--