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 1miyKe-0008Qk-JV for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Nov 2021 12:28:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1miyKb-0004Kp-QR for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Nov 2021 12:28:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1miyKb-0004Kf-HV for pgsql-hackers@lists.postgresql.org; Fri, 05 Nov 2021 12:28:29 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1miyKT-0007vb-Fn for pgsql-hackers@lists.postgresql.org; Fri, 05 Nov 2021 12:28:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3F8B25C0134; Fri, 5 Nov 2021 08:28:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 05 Nov 2021 08:28:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=hksm7XJejrM1kFQWk6b72mq0sjwCZWQNskhsNtQWmng=; b=m/VLhrm4 1sMLjWfNTtDB8b111LBXi6txN2O86a9qgiQtXj1rbiExLChoADnkFCr17Sxp8P8J oVogJHlxnaNMg9XU2SL0OTGF6286Dh+J00QvOBnRqczns3azMPQVFkh7VroLxKMU s/iDU1/SVj5bq5VILwnsmLHthxjx2RAP5cwTuvAX5wPGvsEJj4ID+9ApEhxopaXV Gw8f/lkH/PHv7FINzQu2WOcHNoriLUWeN+72g95wSHQMgSEydo3ViZKhJR45Yh7l 7P9XIFWrioHQdmm6zn0XREluMBnD9Jpka/2pClVan+4cNZa1dn7JhurYHH3JphKP NoK7SZ5aYv4YPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdeigdefkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehtkeertd dttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedujeevjeffjeevud dutedvkeeiueeitddvieelfeekveejudefgeeuvdejhfeuleenucffohhmrghinhepvghn thgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Nov 2021 08:28:19 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AD6C92A0804; Fri, 5 Nov 2021 09:28:16 -0300 (-03) Date: Fri, 5 Nov 2021 09:28:16 -0300 From: Alvaro Herrera To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Fix WAL replay in presence of an incomplete record Message-ID: <202111051228.q6caqqy6ttjb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202111051206.tcvp24m6fxyr@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Nov-05, Alvaro Herrera wrote: > On 2021-Nov-04, Tom Lane wrote: > > > the standbys > > would be unable to proceed anyway in case of a primary crash at the > > wrong time, because an un-updated primary would send them inconsistent > > WAL. If anything, it seems like it might be marginally better to > > update the primary first, reducing the window for it to send WAL that > > the standbys will *never* be able to handle. Then, if it crashes, at > > least the WAL contains something the standbys can process once you > > update them. I suppose the strategy is useless if the primary never crashes. If the situation does occur, users can handle it the same way they've handled it thus far: manually delete the segment from the standby and restart. At least they know what to do and may even have already automated it. The other situation is new and would need somebody, possibly taken abruptly from their sleep, to try to understand why their standbys refuse to proceed replication in a novel way. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "Porque Kim no hacía nada, pero, eso sí, con extraordinario éxito" ("Kim", Kipling)