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 1mRKWP-0006qy-Hf for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Sep 2021 20:31:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mRKWO-0001Eh-Gz for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Sep 2021 20:31:44 +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 1mRKWO-0001EZ-90 for pgsql-hackers@lists.postgresql.org; Fri, 17 Sep 2021 20:31:44 +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 1mRKWL-0002Yh-G5 for pgsql-hackers@lists.postgresql.org; Fri, 17 Sep 2021 20:31:43 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E87F45C00C1; Fri, 17 Sep 2021 16:31:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 17 Sep 2021 16:31:39 -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= fm3; bh=vqd1xCNuNxY+qy89XGLKs95Rf6v2TK94tYu9hX9PF+o=; b=uWaH3QiQ BrS2aul+CDq+SHP9GXiZkA9DdC7Ls7hztgEG2qEYB47iMshbn/Rdqnl5gpo4ClWP 4K38LeBxf/jg5i5ENPaMlK9nMFvMW2c7UEqyQNdbW1xjTBnS9VsAsQfahycJHC22 /gwbNvwyOABarX27yAT2nvCP7sWAWvT5Ze+cNppLXCQtlLCRjO8Hf2E+jdmRy331 BBRok8YQEbO6fyN3eq0xAaLgh41nmu/42aRBGz3eLj1cxamOfd445s+QmX4bxej+ +f1+PfVHA/ln6zrk+Rm6VPDG64zklPJFSs7GcDrcil0YWjEJvOK2ltaFR2nmjTUL AMLJiIUA38Rb6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehiedgudeghecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepudegvdeukefgudelhfdtteeuveekffeuhfduhfeigeet fffhffetgfeuteehueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh dplhifnhdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 17 Sep 2021 16:31:37 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D2CAE2A083F; Fri, 17 Sep 2021 17:31:34 -0300 (-03) Date: Fri, 17 Sep 2021 17:31:34 -0300 From: Alvaro Herrera To: "Bossart, Nathan" Cc: Kyotaro Horiguchi , "andres@anarazel.de" , "masao.fujii@oss.nttdata.com" , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" , "Jakub.Wartak@tomtom.com" Subject: Re: prevent immature WAL streaming Message-ID: <202109172031.67v345vxyano@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Sep-17, Bossart, Nathan wrote: > I gave the patch a read-through. I'm wondering if the > XLOG_OVERWRITE_CONTRECORD records are actually necessary. IIUC we > will set XLP_FIRST_IS_ABORTED_PARTIAL on the next page, and > xlp_pageaddr on that page will already be validated in > XLogReaderValidatePageHeader(). Does adding this new record also help > ensure the page header is filled in and flushed to disk? That was the first implementation, a few versions of the patch ago. An added benefit of a separate WAL record is that you can carry additional data for validation, such as -- as suggested by Andres -- the CRC of the partial data contained in the message that we're skipping. I didn't implement that, but it should be trivial to add it. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ "How strange it is to find the words "Perl" and "saner" in such close proximity, with no apparent sense of irony. I doubt that Larry himself could have managed it." (ncm, http://lwn.net/Articles/174769/)