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.96) (envelope-from ) id 1w5rHv-003hP8-1G for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 20:26:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5rHs-005Bvm-29 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 20:26:41 +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.96) (envelope-from ) id 1w5rHr-005Bve-21 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 20:26:40 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5rHo-00000001Lho-2Cp3 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 20:26:39 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id B430414001B4; Thu, 26 Mar 2026 16:26:34 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 26 Mar 2026 16:26:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1774556794; x=1774643194; bh=KL8sJGROhh tcU5Lo42CepR02w60iDm52S2CRiTz2H2E=; b=J4pux+7403Ij1wR9LDu5M545y0 8p1wZLmiRh0l54g/d7UbMw7grhrD9Y4GJs3gWnKf9f/+YuN9gFb21YY1paSqQtKe gQdwORkBA0SDrhxwW6zyDu0LGkl7UYKn/uxnVAS8/aXK3x/e8JYxfrVaULtgoGBj eI4NXJLgRPEBv21T2BTYQL/xKI3pBuE00UH0kYe3fVcADz/xXM+hIrNpXLovGT/0 QpjXSlDoNuWFRUYXI2u9ZeZlGeqIsH+dlu3uc4a9m/a8cRj4xFhZib+2e/QyL8Ny qeL3tU1ObT3KNtZAnHmtz3Qgg/BumTa7NGdswqAroaST98Wn40g2WI+N3j1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1774556794; x=1774643194; bh=KL8sJGROhhtcU5Lo42CepR02w60iDm52S2C RiTz2H2E=; b=CnvH7d9HZTKfNmZzIiuUrcqikXsko9TEKo7MdsI1zVd29czwAmA bvM0EVg1UF5zPfyoL3MVFW8gj580CWEN4TVbDCjb3o6G7lQy1nJ+D99MkVWS7AhA rrJVUpBsRCI2pDENqB8VZGjF+A2itFImLrGrsZHvxPwf/jVr922I7sTHpWPh78LU 1QHQIt441W7+vueBLGTRZKqzmc+2snINxl1PVRrzSV9mnvCqa2I+yMYlTwMFtWnL IDspGl6jDrjUqM7k23WJNPaNqpI7G5gAKj1zvCIaB/3aaOI39dTtKarjHP0BkWgk PHvvG3MVDRb++wdvVxm3jEU8Ku9DHd3+vaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdekfeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtsfdttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepfeffgfelvdffgedtveelgfdtgefghfdvkefggeetieevjeekteduleevjefh ueegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeegpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehrohgsvghrthhmhhgrrghssehgmhgrihhlrdgtoh hmpdhrtghpthhtohepshgrmhhimhhsvghihhesghhmrghilhdrtghomhdprhgtphhtthho pehthhhomhgrshdrmhhunhhrohesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqh hlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Mar 2026 16:26:34 -0400 (EDT) Date: Thu, 26 Mar 2026 16:26:33 -0400 From: Andres Freund To: Robert Haas Cc: Sami Imseih , PostgreSQL Hackers , Thomas Munro Subject: Re: dshash_find_or_insert vs. OOM Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-03-25 13:55:02 -0400, Robert Haas wrote: > So the patch definitely has some value: it adds coverage of 60+ lines > of code. On the other hand, it still feels to me like we'd be far more > likely to notice new dshash bugs based on its existing usages than > because of this. If I were modifying dshash, I wouldn't run this test > suite first; I'd run the regression tests first. And the patch does > have a cost: it's 334 lines of code that will have to be maintained > going forward. I don't know if that's worth it. I feel like we're a > lot more likely to break dshash behavior in some complicated > concurrency scenario than we are to break it in a test like this. And, > if somebody modifies dshash_destory() or dshash_dump(), they just need > to test the code at least once before committing to get essentially > the same benefit we'd get from this, which you would hope people would > do anyway. None of this is to say that this patch is a horrible idea, > but I'm also not entirely convinced that it is an excellent idea, so I > would like to hear some other opinions. > > Of course, there's also the fact that this patch is quite similar to > some other test_* modules that we already have, like test_dsa or > test_bitmapset. So maybe those are good and this is also good. But I'm > not sure. The good news is, if we do want this, it probably doesn't > need much more work to be committable. I think tests like this do have value and I'd definitely run them first while hacking on code related to dshash, rather than relying on the regression tests or such. E.g. having test_aio was invaluable to being able to get AIO into a stable state. When hacking on something with complicated edge cases I'd just add a test for it, making development faster as well as ensuring the complicated case continues to work into the future. However, creating its own test module for small parts of the codebase doesn't quite make sense to me. A pretty decent chunk of the test is just boilerplate to add a new module, and every new test module requires its own cluster, which adds a fair bit of runtime overhead, particularly on windows. I think test_dsa, test_dsm_registry, test_dshash should just be one combined test module, they're testing quite closely related code. Greetings, Andres Freund