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 1majN0-00031l-Ue for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Oct 2021 18:52:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1majMz-0007SE-JW for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Oct 2021 18:52:53 +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 1majMz-0007S6-Br for pgsql-hackers@lists.postgresql.org; Wed, 13 Oct 2021 18:52:53 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1majMw-00033E-NA for pgsql-hackers@lists.postgresql.org; Wed, 13 Oct 2021 18:52:52 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 90D885C01FA; Wed, 13 Oct 2021 14:52:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 13 Oct 2021 14:52:49 -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=oYEPr7qKuGB+zlLYp8eRxsmJfKqA+Slndd4vaqw5b1E=; b=IYJJBxvo /WXV32nbfkMxvXYOrjMy1eu76DUqRisxTFjLursw1RN8ynPbCH7wLkqFkOviVklk miEZ34Uc926u6gAieu16AwIuKJhlBJQPL4BOdOe6MqxfMLXbAIF7x6HIPdcAiwzX vOjMEU0II7h2lmFm073J29xSXRUbNgsD7KfNwOMXBMQFle4GOLGTRrXnyf6qAtcT aQBlu+/B8OE+gbCni216uR9cidgQsuDzLa6RNcdZBF62IEL5NlUzsdt9YBDYeeoB gj8WGIAzXRaoNV6/RYGM9pOpLmy4qPAFDqBtgj1qxxFlNA0ntYV0v+oYNMPMEuI1 Vc1ADg0I6Ov0Aw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddutddguddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeev jedufeeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Oct 2021 14:52:48 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 9B3D72A06EC; Wed, 13 Oct 2021 15:52:46 -0300 (-03) Date: Wed, 13 Oct 2021 15:52:46 -0300 From: Alvaro Herrera To: Andres Freund Cc: Tom Lane , Andrew Dunstan , "Bossart, Nathan" , Kyotaro Horiguchi , "masao.fujii@oss.nttdata.com" , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" , "Jakub.Wartak@tomtom.com" , Ryo Matsumura Subject: Re: prevent immature WAL streaming Message-ID: <202110131852.rrxabqmxxoiw@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211013183129.jutbvropp7nkg2kk@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Oct-13, Andres Freund wrote: > I added LSNs to the error message: > not ok 1 - 000000010000000000000002 (0/2002350) differs from 000000010000000000000002 (0/2099600) > > It appears that the problem is that inbetween the determination of > rows_walsize the insert LSN moved to the next segment separately from the > insertion, presumably due to autovacuum/analayze or such. > Oh, of course. > Hm. I guess we can disable autovac. But that's not a great solution, there > might be WAL files due to catalog access etc too. Well, we don't expect anything else to happen -- the cluster is otherwise idle. I think we should do it regardless of any other changes, just to keep things steadier. > Seems like it might be worth doing the "filling" of the segment with a loop in > a DO block instead, where the end condition is to be within some distance to > the end of the segment? With plenty headroom? Eh, good idea ... didn't think of that, but it should keep things more stable under strange conditions. > Another thing: filling a segment by inserting lots of very tiny rows is pretty > expensive. Can't we use something a bit wider? Perhaps even emit_message? I think I realized partway through writing the test that I could use emit_message instead of using a batched row insert ... so, yeah, we can use it here also. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/ "La verdad no siempre es bonita, pero el hambre de ella sí"