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 1wx2gE-002Nai-02 for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Aug 2026 13:19:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wx2gD-009C4A-00 for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Aug 2026 13:19:37 +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 1wx2gC-009C42-2N for pgsql-bugs@lists.postgresql.org; Thu, 20 Aug 2026 13:19:36 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wx2gA-00000001Z5N-2EUE for pgsql-bugs@lists.postgresql.org; Thu, 20 Aug 2026 13:19:35 +0000 Received: from [10.0.2.15] (unknown [75.125.238.37]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4hQkYR5pQBzyS5; Thu, 20 Aug 2026 16:19:23 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1787231968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c2DyMpFD1kc98scP/QFrJ3TcfSXkcZeWhPlYjkZktQU=; b=uJX4oBb/bMkfs4vkLfcNFrFwpFd101CzJBQfnoG1yQyPn0ukEEyec+4MVXxuBkcgCcZVWU O3rzVSS5VY355do6oTyblckaVuUYOq2zZ6lPO95xGAzHrkKU3DyuW0y2Su27z1M5rMlG97 PhdkIHYGatFbJNlbWL0vc6NDgYiOBVw= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1787231968; b=LwY0g//+WrZ0nolHMgxpE/bR4xfy9wzYiwtQlpPpCVbCZ0uZ5oHf/8a0xSo6qB98Wi4/gU qEqCMLG3nEP22NOKM1tNjERTQQ/br7znlXgz/0eS1HINLjrrvynOQBQu6/kuDguUAl/n5m OsA4DewgNT7hdaGwpRVZNxxxE971tO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1787231968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c2DyMpFD1kc98scP/QFrJ3TcfSXkcZeWhPlYjkZktQU=; b=A6vdlkSC6GsnNhe0u2458qsxe6Ic8doskeSl61QGy7ePHH+MtyzRGc+yk1lxUnJx4A1hBj sf4hZugsKGhvnn9Fi7eMuBvfFjvpnUcKBapyhzEMNtdtzlcB/0B12El28EgYb6CKeV4boR 6gljoYmUR8MU8CoB6mOgISO26slh3NM= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: <9191f045-1c48-4943-8a2f-91665fc8d018@iki.fi> Date: Thu, 20 Aug 2026 16:19:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SIGSEGV in dynahash To: Tom Lane , Konstantin Knizhnik Cc: PostgreSQL mailing lists References: <16448.1786810349@sss.pgh.pa.us> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <16448.1786810349@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 15/08/2026 19:12, Tom Lane wrote: > Yeah. I'm not too pleased with 9fe9ecd516b for a different reason. > > In pursuit of what seems to be a merely cosmetic goal (ie make shared > hashes be reported differently in pg_shmem_allocations), it's made a > fundamental and IMO possibly destabilizing change in the behavior of > shared-memory hash tables. To wit, it is no longer possible to expand > a shared hash table beyond its startup-time allocation. For some of > them that doesn't matter, but for others it definitely does; the lock > table in particular is sized only heuristically. For the last couple > of decades, there was slop in the max_locks_per_transaction limit > because the lock table could grow into the 100kB slop space we leave > in shared memory; but now there is no slop. I suspect we will get > complaints from people whose workloads used to work without trouble > and now don't. There might be extension code that depends on shared > hashtables not having a hard limit, too. > > I wonder whether we shouldn't just revert this. This was discussed at the time. My opinion, and I thought there was a consensus on it, is that the unpredictable behavior of the "slop" was not a good idea. The slop got assigned to whatever hash table happened to use it first, and from there on it was reserved for that hash table until server restart. That's pretty unpredictable, and hard to reason about for tuning purposes. It was all about the lock manager, none of the other hash tables used the slop. The lock table consists of two hash tables, the "LOCK hash" and the "PROCLOCK hash". The slop would get assigned to one of those depending on the kind of queries you run after server startup. If you ran a query that happened to need a lot of "LOCK hash" space, and then ran a workload that needed more "PROCLOCK hash" space, the latter would fail. But if you ran the queries in different order, then the slop was assigned to the "PROLOCK hash" and it would work, but running the other kind of query would fail instead. Weird. I increased the default for max_locks_per_transaction (commit 79534f9065) to compensate for this, so that most applications that were using the default settings and were relying on the slop will continue to work. - Heikki