Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyXrU-0005lT-Fe for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Feb 2019 08:13:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gyXrT-0001OL-5s for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Feb 2019 08:13:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyXrR-0001NQ-Db for pgsql-hackers@lists.postgresql.org; Tue, 26 Feb 2019 08:13:10 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyXrM-0002Uc-O9 for pgsql-hackers@lists.postgresql.org; Tue, 26 Feb 2019 08:13:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 7BC65331E; Tue, 26 Feb 2019 03:13:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 26 Feb 2019 03:13:01 -0500 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=BIsq1hP+JjZ4AKU9TOKmLVuUmi+ hKpxUiw4qwggrB0I=; b=bvGSdskMgjj4JydzIUPkNwrSNI5E+h4bTXgI6TOPi+C slm87+c7x6zvD39k90FkTdYH5Fkr0WBeJBKPS5ikUZH14/puK8xSfpWA+IAwB6Nt SI6JBs7GFj6ZV3H5gVyMqzYh8d+k08ebssr0Lor4dTG0ViCWxNdnqchHHQFpjTjY 9pj5xqQfFyomrsaW2eVADVi1Yd4hsn3VrNVn3cMyAahIILcSgXQYYec1f225V/6q 5qZufEgJUpB6AJyjwPsanwVMlTU4HWgZLJgaX1f44ADP/PemukWGjZ7z0y2ECNtd laFv/RPFlRGIoHQwPrUXFDbBlXa2j6rZFR1UpcZDipw== 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=BIsq1h P+JjZ4AKU9TOKmLVuUmi+hKpxUiw4qwggrB0I=; b=8VpeaJz+O9ilX4tCko+y2+ j3VVszT1j5SppZgElIjTVTE6XVW/UQ//uSbiTs6EUiv2gvXxHWjuCcFrZkq+0Xku OJ/LQ9eeZqh4bN3Qiv0M6yNi/dTHzrHWHziDyUiRCa9ElSYcCCdQSF3MyQjVFt6D JWt75ljvu+HprdpwYjxKZhyo3DBvteFRuDH6PzTui0RAH8CaRupoPLkacrdQ0sw0 uk0DMOkDULNc8FwxDxQXc7LdnuFNQUYLp0BHLIj7L/K6VKSbP5eO3J/vyjsA1z6w Cpu/o3kR8tLTINkuhuHLQ9MQ7soMEv62JxW7KFV657JWfiogkYIoogb7cUuOa0Ww == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrudekgdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecu kfhppeeiuddrvdduhedrudefjedrudeivdenucfrrghrrghmpehmrghilhhfrhhomhepmh hitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 80B0410319; Tue, 26 Feb 2019 03:12:58 -0500 (EST) Date: Tue, 26 Feb 2019 17:12:55 +0900 From: Michael Paquier To: Kyotaro HORIGUCHI Cc: leif@lako.no, pgsql-hackers@lists.postgresql.org Subject: Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write Message-ID: <20190226081255.GK27822@paquier.xyz> References: <15589-8e6e353a97b085fb@postgresql.org> <20190131.212648.235621599.horiguchi.kyotaro@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bgLLobvf7eP6VP5c" Content-Disposition: inline In-Reply-To: <20190131.212648.235621599.horiguchi.kyotaro@lab.ntt.co.jp> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --bgLLobvf7eP6VP5c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 31, 2019 at 09:26:48PM +0900, Kyotaro HORIGUCHI wrote: > I don't think no one expected that server follows > recovery_target_action without setting a target, so we can change > the behavior when any kind of target is specified. So I propose > to follow recovery_target_action even if not rached the target > when any recovery target isspecified. Quoting the docs: https://www.postgresql.org/docs/current/recovery-target-settings.html recovery_target_action (enum) "Specifies what action the server should take once the recovery target is *reached*." So what we have now is that an action would be taken iff a stop point is defined and reached. What this patch changes is that the action would be taken even if the stop point has *not* been reached once the end of a WAL stream is found. + * to be taken regardless whether the target is reached or not . Nit 1: Dot at the end has an extra space. Nit 2: s/specfied/specified/ Please do not take me wrong, I can see that there could be use cases where it is possible to take an action at the end of a WAL stream if there is less WAL than what was planned, perhaps if the OP has set an incorrect stop position too far in the future, still too much WAL would have been replayed so it would make the base backup unusable for future uses. Also, it looks incorrect to me to change an existing behavior and to use the same semantics for triggering an action if a stop point is defined and reached. -- Michael --bgLLobvf7eP6VP5c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlx09QcACgkQnvQgOdby QH3jMxAAkPGQQxRKKAqkijjv2e0pI+l7aD+PV3jhqbIgTLOckIoH3nSupZrtsYOr FdQLEdWxf5+XG1WcJmq0k2zak6jubyEpeyuwMvuy4KV5f8FtGMqOrw9i2XVDzpjQ 8C/IY5gKbcE2f+UTGlFBiPE5AEyHPt/oByP4MdGZ/EHxCG7Eaub9xl02r2N94UyM Xyfx30xQOSOFPQBTz6auOOzjMsjqmMw4pVULA4XhbpB2EDOTehwGvx60F02aGmHx Ad9YROdfttaVcoItvvzEOr2UPiZqB4aQQlC6FlpuFMBN8Jf+gXZz0LCDreHB0O4X hbnkrymSvGDXZruvcZIsSl9eiDvpRJgK9XGH8zlZ+a3JKhDRZqhgHXbSbu4fJcTp 1zEbq3ldE47S8k7HtmlGmxMbqQFPaFBC44cq8RosQBQJtcnldVlQSPo1Czd/VhW1 5c56uxn3lnZoBmOben47EkW32y5ekVL4765Ijd4pM1zoZkOchOHPlWXKcfb/SQg5 Ax1IAlABYO7qQUes5s/Q0SAwWufh9t/wb2ikDWp/MBiyf5pwjjqOCfnKerkszLB1 bbgvxfifYVVr6Jbz/jxcSlSSU/f1+lLlip/g2loqDdrF09XHDAIyQwnqa8yBxaJu CkI0N58wZDXrxu4IKnb/cI0Z6H+aQKyGB/WYUK4FQtMyB+JLQm8= =/PSG -----END PGP SIGNATURE----- --bgLLobvf7eP6VP5c--