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 1mSQ7Z-0006lq-CN for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Sep 2021 20:42:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mSQ7X-0003AT-VD for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Sep 2021 20:42:35 +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 1mSQ7X-0003AL-NO for pgsql-hackers@lists.postgresql.org; Mon, 20 Sep 2021 20:42:35 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSQ7V-0000TN-3Q for pgsql-hackers@postgresql.org; Mon, 20 Sep 2021 20:42:34 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 0C7A63200D18; Mon, 20 Sep 2021 16:42:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 20 Sep 2021 16:42:31 -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=h95HfR391eQEp/6jMRg+7CaxpWnWzOJzmkFoan1LnsU=; b=EFiXcgJA gvky6XIyguthjT46yK1w2XhuBF6M5Vyg5qPwx8Qcvv9pmtN4DcQ445nVUaOH3M3A 5eYBemu1nWeQqMPI+oL+9RoyQ2wDhb3Ui6XVxDBkqmSVqyDCHotWknpH/EiYQwT0 j2W+SiBtNeUlQ1NAPm/BIywhI70a4aHCffR/NcV34S8+fcliN3D5YcwhTNaHGQef tEoqGQsMf7OvUsmygJnIjTgCJUZivvYbSDI4tGwEULwjOtDhZwtAraHrJyJCZ+YI 96PnDFj/iBSbFi8X5vlKV3+MA6Rpnx/6FymLKHkjAGQCF2+Khhw7GzCW6G/mbiS7 ySUyXuGG8PY2gw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeivddgudehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepudejveejffejveduudetvdekieeuiedtvdeileefkeev jedufeeguedvjefhueelnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Sep 2021 16:42:29 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AF2362A07B8; Mon, 20 Sep 2021 17:42:26 -0300 (-03) Date: Mon, 20 Sep 2021 17:42:26 -0300 From: Alvaro Herrera To: Robert Haas Cc: "Bossart, Nathan" , Dipesh Pandit , Kyotaro Horiguchi , Jeevan Ladhe , Stephen Frost , Andres Freund , Hannu Krosing , "pgsql-hackers@postgresql.org" Subject: Re: .ready and .done files considered harmful Message-ID: <202109202042.uziogfq245yw@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-20, Robert Haas wrote: > I was thinking that this might increase the number of directory scans > by a pretty large amount when we repeatedly catch up, then 1 new file > gets added, then we catch up, etc. I was going to say that perhaps we can avoid repeated scans by having a bitmap of future files that were found by a scan; so if we need to do one scan, we keep track of the presence of the next (say) 64 files in our timeline, and then we only have to do another scan when we need to archive a file that wasn't present the last time we scanned. However: > But I guess your thought process is that such directory scans, even if > they happen many times per second, can't really be that expensive, > since the directory can't have much in it. Which seems like a fair > point. I wonder if there are any situations in which there's not much > to archive but the archive_status directory still contains tons of > files. (If we take this stance, which seems reasonable to me, then we don't need to optimize.) But perhaps we should complain if we find extraneous files in archive_status -- Then it'd be on the users' heads not to leave tons of files that would slow down the scan. -- Álvaro Herrera 39°49'30"S 73°17'W — https://www.EnterpriseDB.com/ Maybe there's lots of data loss but the records of data loss are also lost. (Lincoln Yeoh)