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 1nSU3y-0008Ff-KP for pgsql-committers@arkaria.postgresql.org; Fri, 11 Mar 2022 01:27:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nSU3v-0001Vt-Ut for pgsql-committers@arkaria.postgresql.org; Fri, 11 Mar 2022 01:27:23 +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 1nSU3v-0001Vj-F9 for pgsql-committers@lists.postgresql.org; Fri, 11 Mar 2022 01:27:23 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSU3o-0006KT-Tr for pgsql-committers@lists.postgresql.org; Fri, 11 Mar 2022 01:27:22 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 1CCCA3200B25; Thu, 10 Mar 2022 20:27:15 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 10 Mar 2022 20:27:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=Kn7PxvVBI+7Bd5KNGCbyCEsEuR8EcDiR66euUX omqVs=; b=PssV6rK/HElN9Ej8bzlYRtBRe3i627b8CrodkpZnA2dHREP3ZZDTRS JTVMbofRVkDCmGynSlUuYoSGKjUNZV9Zvne7UZ3+dGJ7F0zBUJ60ETy6DZV4ilce UN+VYbpsVDZfAAM4Inp58KPrMe20Ii4qpUGlSIUhpyah4d8CZv0NREzO7keRLDz1 Von25OAjS5HX5NYPuNJ9Et2CUHVpe9S6F5he9YUX5TqA1QRJTCoGEmT98dLzU/dU m/+Rcn9B0zS+OhRXA+C/B8OfrxU8X7qCsVTQ2ffDUOMDM+NAw/YvpQrq4hI82ebG 5iKffezf3G30F3LBmn8FZT/vmvfz1RPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Kn7PxvVBI+7Bd5KNG CbyCEsEuR8EcDiR66euUXomqVs=; b=YMD9Xwwaz7MljKSAlQWnKXXsFbP7FVNDg L5HUAFZgW8KA3qEkq9HTnGqCslKPmpTiNcuSYsct/lWCPYTf27Vcr+lzZgP0CPYl q2jck9qc6gur7w5mb9H8gyYGllzpwc3v59JWO+89imlWDrmhM79R/S0PJtAFUUC4 EE0Me2SNGj209DBq7MWgFTixKBdRjsRemzdnU06b+LTUjHa3Dh9Nf/Jqhi6gyA4y PGceP4IBumJJd2AQ0P+bu+Svy2hlav+jdVngn7dcRD/Fiu7CMy16NFd6JArf40D0 4maOm3AZN2NScRFXGU/NFxUO/fTiCuBYRC6vVXYSqzX4SHV62ZduQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddvuddgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Mar 2022 20:27:14 -0500 (EST) Date: Thu, 10 Mar 2022 17:27:12 -0800 From: Andres Freund To: Tom Lane , Thomas Munro Cc: pgsql-committers@lists.postgresql.org, Kyotaro HORIGUCHI Subject: Re: pgsql: dshash: Add sequential scan support. Message-ID: <20220311012712.botrpsikaufzteyt@alap3.anarazel.de> References: <758107.1646960996@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <758107.1646960996@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-03-10 20:09:56 -0500, Tom Lane wrote: > Andres Freund writes: > > dshash: Add sequential scan support. > > Add ability to scan all entries sequentially to dshash. The interface is > > similar but a bit different both from that of dynahash and simple dshash > > search functions. The most significant differences is that dshash's interfac > > always needs a call to dshash_seq_term when scan ends. > > Umm ... what about error recovery? Or have you just cemented the > proposition that long-lived dshashes are unsafe? I don't think this commit made it worse. dshash_seq_term() releases an lwlock (which will be released in case of an error) and unsets hash_table->find_[exclusively_]locked. The latter weren't introduced by this patch, and are also set by dshash_find(). I agree that ->find_[exclusively_]locked are problematic from an error recovery perspective. It's per-backend state at least and just used for assertions. We could remove it. Or stop checking it in places where it could be set wrongly: dshash_find() and dshash_detach() couldn't check anymore, but the rest of the assertions would still be valid afaics? Greetings, Andres Freund