Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBvLO-006z9J-BG for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Nov 2024 12:22:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tBvLK-009Pgh-UF for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Nov 2024 12:22:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBvLK-009PgZ-BE for pgsql-hackers@lists.postgresql.org; Fri, 15 Nov 2024 12:22:31 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBvLG-0024IJ-PB for pgsql-hackers@postgresql.org; Fri, 15 Nov 2024 12:22:30 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id 3B5B725400C7; Fri, 15 Nov 2024 07:22:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Fri, 15 Nov 2024 07:22:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731673345; x=1731759745; bh=D ccT3f41bjd30SVHKNgx1U4PQwdjtaWinmx0ovQ7a9s=; b=HZ5OuZId+WKmnLFwp ZGFDOiEcc2Skjqrbij6mtp3mxZa7YqTjLBVMtlzvsg3eEGxi0VqOhaD9efqY1b9m pTDpunDBXAntJx2/TiwxQW46OII3/KeidhDRUSB5GTHQ6GIElsOo00AygW3rwnFH 3jcIL+mmzGel5MXue3FTJn/N2UbNqpCMhCnsyr/Tyquaqmo1ktb3n5VVnoAYVT+B tc03xwBKfID/bg2wtLcCkS/xb/XdDhN/8Xyvc1zhMhMqgOHtb2t0rJVtQjnh2xSX RMUQQHx8mIFOiWrsvhlOmhvGtM2d/IZfqxCxd36hi6w/4G0MZlc4gJs4lIV/tqPE +opog== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvdeggdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuf fkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgr uceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvg hrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeekfffgudffhfduffffueev necuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhh rdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeelpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopehkohhusegtlhgvrghrqdgtohguvgdrtghomhdprhgtphhtthhopegs uhhnghhinhgrsehgmhgrihhlrdgtohhmpdhrtghpthhtoheptgihsggvrhguvghmnhesgh hmrghilhdrtghomhdprhgtphhtthhopehhohhrihhkhihothgrrdhnthhtsehgmhgrihhl rdgtohhmpdhrtghpthhtohepshhmihhthhhpsgdvvdehtdesghhmrghilhdrtghomhdprh gtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhq lhdrohhrghdprhgtphhtthhopehtohhrihhkohhshhhirgesohhsshdrnhhtthgurghtrg drtghomhdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghp thhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Nov 2024 07:22:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1731673341; bh=xu67J8aGy+ZkK1CSkodk0YhF2dKkcM5y9z3UBgPBunc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=oRs5zj7N2MwBaEv+f91Ut/2aU9mKUEEG1yM+3Aysfm87rZsOV5d8iiNvKa/ILX/mi UhI7aYig5JOCVfz73cD7APH4cv0CXbdanImG4X0EfcUQK4f5m/iFklwN0UCg8iJy3h zVgpu+smJVhXJiaDFZ8lO+j0OB+fGpmIU6bNg36/RuqYWL+608FNs1y++QqL7HCyuv sDWM7M9PMeIhTIuTQRbMLaEoU/zChFs4iuGdJhnZa5g4KVElK1DUd4lYVAxBoQt7NU U36qLj3IP0xR2fCqvNsmi/SUToc/SKidb+s033pMqnv9o51xwlu5JQWWfR4bXTFyK7 EsXOYnFs3QLyQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id CFC459B; Fri, 15 Nov 2024 13:22:21 +0100 (CET) Date: Fri, 15 Nov 2024 13:22:21 +0100 From: Alvaro Herrera To: Alexander Kukushkin Cc: Sutou Kouhei , smithpb2250@gmail.com, torikoshia@oss.nttdata.com, horikyota.ntt@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org, bungina@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: pg_rewind WAL segments deletion pitfall Message-ID: <202411151222.7qbg5ujnrnxt@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 Hello Alexander, On 2024-Nov-14, Alexander Kukushkin wrote: > The commit message looks good to me, except maybe using a "master" word, > which I would suggest to replace with "primary". Oh wow, thanks for noticing that. I had already rewritten the commit message to some extent, but "master" had remained. Now I pushed the patch to branches 14+, having replaced it as you suggested. (This reminds me that I used to have a notification set in the 2ndQuadrant Mattermost instance so that I could LART anybody who used the words 'master' or 'slave' in the chats there). > + /* > + * This hash table is empty in the vast majority of cases, so set an > + * initial size of 0. > + */ > + keepwal = keepwal_create(0, NULL); > +} > > I don't think that the hash table will be empty. It needs to hold all WAL > filenames starting from the last checkpoint and up to divergent point. > On loaded clusters it could be hundreds and thousands of files. Oh, okay. The initial size is just there to avoid having to grow the hash table, but using the same constant that we use for the filemap hash table seems good enough ... it shouldn't make much of a difference in practice. Regards -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ It does it in a really, really complicated way why does it need to be complicated? Because it's MakeMaker.