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 1w5uCE-003k9N-1J for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 23:33:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5uCC-006V3T-2t for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2026 23:33:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5uCC-006V3L-1y for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 23:33:01 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5uCB-00000001Dtz-0F10 for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2026 23:32:59 +0000 Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id 8F5331D00197; Thu, 26 Mar 2026 19:32:58 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Thu, 26 Mar 2026 19:32:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=1774567978; x=1774654378; bh=MGJTDE7L3J jQVodM6XolkmdIz/k2ML/dAc8yW5M1gHk=; b=XWZOu1k9nBWxCUsg756gLYIWU1 jAA9i4IVxWT7uY/DNhRU2gdOXfuy1xhMtF+TYvBO1dXeNYo8YP3THFfczzMMtRyU bqBXKySxcotbMSuaoUncBMvxdnhDZ7101vwOlOfKfav1yupw4JQ6Rk8z17x/Ow4m X3wHK68m6ljtdHkhNbVCuql0KBR0dPyVsSYSRz9iemgTy21FBiljUOGhDnJfVGah Kp/lrCLWB7mNuaFSTZec2pnL2E66qf6ihZQb7c60PCxdf1uwExZgSc+XY5Vezgoh JtoXCJgR7pSdd85Wu7bWNyJrch4QciIdZL1zlf3hQ5CNMrGl+/sCd8qZMNmA== 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= 1774567978; x=1774654378; bh=MGJTDE7L3JjQVodM6XolkmdIz/k2ML/dAc8 yW5M1gHk=; b=EDpFY2VbB8JGAKhJ0X/hL0gMInSFcKrJGJWjDkdHFsgJhYe5NG3 IhHdtcQqBw8hXqm7lqQPvGhRPc0UDHr2xtBFeUDbV5KEjRO1ORkEYKvw8Bd1D8LY vPd9BPmKsfD1Kgg6HbwxTA6Itju+66/Nd2KZ1ux9nYItdWlipdBewAdJhjcy27Vq gdcpjnFZRuJzAS/zqMXEI1TD/A+JSvWK3/44eZ2N251agIKjr8QhneTSU5FuTKGy b76y4Uj2pxn1jQt6gut+0IrNaF7RZpjPEdbXeSYlIIfadhLlr4fhfPLSJ7HyWB2G Jyr0twx9dYL1FGLXeQANVrZ+CLxFlz68D2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdekjedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtdorredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepffduleehgefhkeefgfeftdfhkedu tddvhfdukeeggeehieekffelhfelkeehteefnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghnug hrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtoheprhhosggvrhhtmhhhrggrshes ghhmrghilhdrtghomhdprhgtphhtthhopehsrghmihhmshgvihhhsehgmhgrihhlrdgtoh hmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhr vghsqhhlrdhorhhgpdhrtghpthhtohepthhhohhmrghsrdhmuhhnrhhosehgmhgrihhlrd gtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Mar 2026 19:32:56 -0400 (EDT) Date: Fri, 27 Mar 2026 08:32:52 +0900 From: Michael Paquier To: Andres Freund Cc: Robert Haas , Sami Imseih , PostgreSQL Hackers , Thomas Munro Subject: Re: dshash_find_or_insert vs. OOM Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n8oHdY69QRSVzQ1U" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --n8oHdY69QRSVzQ1U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 26, 2026 at 04:26:33PM -0400, Andres Freund wrote: > 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. These test modules have a lot of value because they are cheap to run and are very usually able to reproduce edge cases that no other place of the code tree would be able to reach in a predictible way. Cheap, fast and reliable is good. On top of that they can serve as code template. Bonus points. > 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. Yeah, perhaps grouping all the DSA things into a single module would be OK, with a parallel schedule that would speed up things. It depends on the complexity and the size of the module to me. Saying that, I think that the shape of the proposed test_dshash is wrong: it proposes one SQL function that does a bunch of dshash-related operations in a single function call, in a random manner. We have a shared memory state that can survive across SQL calls, making it a set of thinner SQL function that wrap directly dshash calls able to manipulate the table would feel much more natural to me. And it would be easier to design edge cases in the SQL scripts themselves. -- Michael --n8oHdY69QRSVzQ1U Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnFwiQACgkQnvQgOdby QH0Q3hAAjP2x2z5LxHTuBwlCV4a9VCsGkMqRMGfnV2lIFHpoEZpZULcTNxgzxHSW /s0FxWOmNGd8qrbAR9x9OJHEaugR9ZJpHa80cK7S69XvXSrWzF88UMPWpv4nD+H+ t3qqakBGcrZ9VzNqc4pBcf5amWngfJL9AWS7I5pA0EeG4f4qZdKXlRilgt6aJerH 1nSPRmRF6/IQXm1JRgg5MZfRRd7l/0OC5XP5mFvN6qzMDQPcA87aJ5HMqC7pVs9l 75TCfLcsfmF4OMiiv8bbgMHcnUWdO37LsPPL1bA82XKshRRHW2gE6x+SFIu5gPy4 64Z12ldmWisjAlwgETZo5rwvjWfgF7p4ZtZpwBwSHukgBhx2RoHcyx9hSJv7PXoW 5aPVaLfAiyvp9qdtXlYUSjTbXOOzPbXArXOMxiRoicJqV9U84fqdeFZHeZn+Hgm7 NYhEYKCMNOFCHLsRuSqqXqGSXmuSh4nRHuMIKrwuDQKk4PYEXjrlYnVdY0rIlBB3 C+fg4czlrNvssVSddkpJqaWHIwehy73d9WQYLRhXJDqSoIL1YypR1CK3JkvYRBQ0 FSMbllzDr0HhKlGymqEXB3kJXz6rM0MU4/eK7jmfVC8OWmbwWBCZeNTPnW1QqSBc Egw/6N3CBzCSkTATrIOArChZhFqt4n020bCeaoHN8tKFILzm0js= =nvq7 -----END PGP SIGNATURE----- --n8oHdY69QRSVzQ1U--