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 1mJ2LQ-0005Ky-AE for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Aug 2021 23:30:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJ2LO-00048X-3p for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Aug 2021 23:30:06 +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 1mJ2LN-00048J-2k for pgsql-hackers@lists.postgresql.org; Wed, 25 Aug 2021 23:30:05 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJ2LI-0003F3-4S for pgsql-hackers@lists.postgresql.org; Wed, 25 Aug 2021 23:30:04 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 74A885C01EF; Wed, 25 Aug 2021 19:29:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 25 Aug 2021 19:29:58 -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=vrYBX+J11VVedY4axJJB9aB9qP6sdVvV3RZyrJhfZSU=; b=B+frFHRc Y+HrLBNEKG2VMXVJh8enQKL7pc0Weg9gNeA/tKr5ZEoQPS2gCDphhp5VPNngmlXY jVJzra06IL3IttHdIkN78beNCRsE7SkCAZub3U7rHEwkMtRTLqjnab5X9/zUQO4U MAFb7SUQRe/86l7MeeLuxcuYP6nspQLMfl32OEZdfPOMIdvj0m7lA4ngF3JpxU0L 8/KXo96TfCvURKlWijgCV8eTPuT5co1eb7PTsgUoDWpRgFSO5IZjVmI0shR/9U/O sYJRx3lnBypUdsZle7sYViZduK4Zlctj1ek1Tb/kxLRSZQcuS6K7LcJTiZu/nMPi Fs2wotZ80tWIsQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddutddgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpedfrghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdfuceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhephfdufedthfelveegjedtffdu leekiedugfdtgfdttdevteejleetgefhueeigfetnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Aug 2021 19:29:57 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 530242A06AD; Wed, 25 Aug 2021 19:29:54 -0400 (-04) Date: Wed, 25 Aug 2021 19:29:54 -0400 From: "alvherre@alvh.no-ip.org" To: Jakub Wartak Cc: "Bossart, Nathan" , Kyotaro Horiguchi , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" Subject: Re: prevent immature WAL streaming Message-ID: <202108252329.oqhdllz2iq73@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-Aug-25, Jakub Wartak wrote: > In order to get reliable reproducer and get proper the fault injection > instead of playing with really filling up fs, apparently one could > substitute fd with fd of /dev/full using e.g. dup2() so that every > write is going to throw this error too: Oh, this is a neat trick that I didn't know about. Thanks. > After restarting master and inspecting standby - in all of those above > 3 cases - the standby didn't inhibit the "invalid contrecord length" > at least here, while without corruption this v02 patch it is > notorious. So if it passes the worst-case code review assumptions I > would be wondering if it shouldn't even be committed as it stands > right now. Well, Nathan is right that this patch isn't really closing the hole because we aren't tracking segment boundaries that aren't "earliest" nor "latest" at the moment of registration. The simplistic approach seems okay for the archive case, but not for the replication case. I also noticed today (facepalm) that the patch doesn't work unless you have archiving enabled, because the registration code is only invoked when XLogArchivingActive(). Doh. This part is easy to solve. The other doesn't look easy ... -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/