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 1mIs5I-0004Rk-7T for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Aug 2021 12:32:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mIs5G-0007TW-5E for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Aug 2021 12:32:46 +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 1mIs5F-0007TH-71 for pgsql-hackers@lists.postgresql.org; Wed, 25 Aug 2021 12:32:45 +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 1mIs58-0002lh-IQ for pgsql-hackers@lists.postgresql.org; Wed, 25 Aug 2021 12:32:44 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0B5EC5C0181; Wed, 25 Aug 2021 08:32:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 25 Aug 2021 08:32:37 -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=CQKJ2LIZaQ1abb2REz+Lk/gmv4Wrdz2zeE/mLaFCkWw=; b=wLHW7+np rDcAUpWxzWTzHN8l+vzkg+Q+P+/lkIHRODZ0LjTaMbxcpoOlWL8v9a5QN/pIC9C3 5JljqFdL25OnjTolCkxv5H4UuFE5FiQzfs/QSzjg6yULIQXUKZnA9AhDC6aIYLPr oiyKAJtQEvLIT1W/5rf2xWbEcpVD+Z8U5LWQR02XaXNQQ/FXAHwqp8dgHEIiahag lzCnf9IfRlZswBKoDIsQs0wXcte8VgI+4e1dmGT22r/t3UQNGh5DhaCrqkBU3llY z9f93djdeo33j8aYEey2/lCeFr0csTuLsTzB5DH25b5E3OBg9LnCz1h/CDb7TW5/ e6hmIHsHJ9aWGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtledgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpedfrghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdfuceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhephfdufedthfelveegjedtffdu leekiedugfdtgfdttdevteejleetgefhueeigfetnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Aug 2021 08:32:35 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 34F6B2A06E9; Wed, 25 Aug 2021 08:32:31 -0400 (-04) Date: Wed, 25 Aug 2021 08:32:31 -0400 From: "alvherre@alvh.no-ip.org" To: "Bossart, Nathan" Cc: Kyotaro Horiguchi , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" , "Jakub.Wartak@tomtom.com" Subject: Re: prevent immature WAL streaming Message-ID: <202108251232.aaxpgvj3rcvw@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8687C486-BC80-4150-8519-13FE395485BF@amazon.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Aug-24, Bossart, Nathan wrote: > If moving RegisterSegmentBoundary() is sufficient to prevent the flush > pointer from advancing before we register the boundary, I bet we could > also remove the WAL writer nudge. Can you elaborate on this? I'm not sure I see the connection. > Another interesting thing I see is that the boundary stored in > earliestSegBoundary is not necessarily the earliest one. It's just > the first one that has been registered. I did this for simplicity for > the .ready file fix, but I can see it causing problems here. Hmm, is there really a problem here? Surely the flush point cannot go past whatever has been written. If somebody is writing an earlier section of WAL, then we cannot move the flush pointer to a later position. So it doesn't matter if the earliest point we have registered is the true earliest -- we only care for it to be the earliest that is past the flush point. -- Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/