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 1o8HV4-0003gc-TT for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jul 2022 08:32:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8HV3-0005zr-Pb for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jul 2022 08:32:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8HV3-0005zh-Gc for pgsql-hackers@lists.postgresql.org; Mon, 04 Jul 2022 08:32:09 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o8HUm-00029J-EL for pgsql-hackers@postgresql.org; Mon, 04 Jul 2022 08:32:09 +0000 Received: by mail-pj1-x102c.google.com with SMTP id o3-20020a17090a744300b001ef8f7f3dddso377842pjk.3 for ; Mon, 04 Jul 2022 01:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=5hAmc2xQs4nX1nV6P+hvf9vjy78szt/JdDCrC5sZ9Qw=; b=I8tp1DmqXrcgwgQtVS5ZjU6DOzULAtbqpOTt7SO1JVyCZHjmAxWAnsyObyfLN3U7Uo UHzhcTcJTn3rrg1s6d1YZqzyMIPIfHGAKH9/8fHp8UInRbT2gRDT5gMS0NhYxUy6xmh/ TcFRp8+o26zIycVXThVLplfjwHkmSkEJw0Fm10Win2euLhnGb9Ppm/jV6mej5L+wXAdo 4wiomswP/My9Psop9Wej2n1CIZmPtDsKBXDjlR/m5U/aZBOzNLhn31sq00XEBQRTZBDE biNN7tiRgHblCDm4MbkCsqS2i9xw2r9sgFthZAzyetXeH/84PVssrNdNoTVHx38PbtvX xHoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=5hAmc2xQs4nX1nV6P+hvf9vjy78szt/JdDCrC5sZ9Qw=; b=XseOUutxzkCvMsyeuPqlYEcchQni9NSpHtA/XSCbbnkaY30UckT0Pmd8GXXZe17TNk aZHcgrn8vLsGJwtwguttR9h4YV3qh8QKhnyFLuNprbNCD8WNx/4qmjFFEj+KYgwcqKQI Hrh8UvEgR9OMuIEyBZ10GFT72Lc4A/NcgLA6+TpwXYRcPC7TlTpYtluHLyhFIU1+ajHZ yH4icjWmZOEe/i87RtUJ3xHQRZtwpXsC9kkSe1WWk1aHsAaefH6Nu5TPI0RGLLbCdGJr dC+Os8GPOinySWMVx9tf3oZ132uFBPAFnq/Et7PZglBGkS4BobYfD+PBnJoCK9USq1jY 0ggA== X-Gm-Message-State: AJIora+nYBdfn8osUSHM2DXCgrvOnFT2HpKfm5Wqxxl1xgjmTy1UIPtK Q8VlPayvlN+Td8mg7MWrHgc= X-Google-Smtp-Source: AGRyM1tCafCpZfPiYDHQxuLEmFQRHGftvFCSpipgRKxnOWa8gGoqd0Vqh2EbmMdb8lRO1F1d34m3RQ== X-Received: by 2002:a17:902:f54a:b0:16a:5850:5775 with SMTP id h10-20020a170902f54a00b0016a58505775mr35750437plf.13.1656923510188; Mon, 04 Jul 2022 01:31:50 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id s21-20020a056a001c5500b00525869e6ffasm18352403pfw.120.2022.07.04.01.31.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 04 Jul 2022 01:31:48 -0700 (PDT) Date: Mon, 04 Jul 2022 17:31:46 +0900 (JST) Message-Id: <20220704.173146.2012454546941903025.horikyota.ntt@gmail.com> To: thomas.munro@gmail.com Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, horiguchi.kyotaro@lab.ntt.co.jp, pgsql-hackers@postgresql.org Subject: Re: pgsql: dshash: Add sequential scan support. From: Kyotaro Horiguchi In-Reply-To: References: <758107.1646960996@sss.pgh.pa.us> <20220311012712.botrpsikaufzteyt@alap3.anarazel.de> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Mon, 4 Jul 2022 14:55:43 +1200, Thomas Munro wrote in > [Re-directing to -hackers] > > On Fri, Mar 11, 2022 at 2:27 PM Andres Freund wrote: > > 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? > > Yeah, it's all for assertions... let's just remove it. Those > assertions were useful to me at some stage in development but won't > hold as well as I thought, at least without widespread PG_FINALLY(), > which wouldn't be nice. > > *dsa_get_address() might need to adjust the memory map with system > calls, which might fail. If you think of DSA as not only an allocator > but also a poor man's user level virtual memory scheme to tide us over > until we get threads, then this is a pretty low level kind of > should-not-happen failure that is analogous on some level to SIGBUS or > SIGSEGV or something like that, and we should PANIC. Then we could > claim that dsa_get_address() is no-throw. At least, that was one > argument I had with myself while investigating that strange Solaris > shm_open() failure, but ... I lost the argument. It's quite an > extreme position to take just to support these assertions, which are > of pretty limited value. > > [1] https://www.postgresql.org/message-id/20220701232009.jcwxpl45bptaxv5n%40alap3.anarazel.de FWIW, the discussion above is convincing to me and the patch looks good. regards. -- Kyotaro Horiguchi NTT Open Source Software Center