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.94.2) (envelope-from ) id 1r0sIJ-008GYM-VQ for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2023 23:49:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r0sII-008iKK-8V for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2023 23:49:10 +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.94.2) (envelope-from ) id 1r0sIH-008iIR-QZ for pgsql-hackers@lists.postgresql.org; Wed, 08 Nov 2023 23:49:09 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0sIE-004eSy-Mk for pgsql-hackers@postgresql.org; Wed, 08 Nov 2023 23:49:08 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (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 lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4SQhcs6bpYz49Q1r; Thu, 9 Nov 2023 01:48:59 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1699487343; 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=Hzj/RqFQqfBRSUcxouQxkQID9aiYmCvSyWtdlVpf1dA=; b=vNUozCVfacGVAfWvOrdPtKXAMheX8J64A/THl7pJ+GW4hNBWoAoDs847OsVJisBDUvZfaq zd6hRsQI1BiduWSdCjVtAxu9NwxxZ8O4F+edCI2TFXhEE82AttHP7TMRBntu5S8jsZwbVy gLSNIzwSxUSDpht+auqD3E944E0CAWnj/Z2LniYTMFuYG/pYZdojSY3SEuWWQ0K0K4mxk0 B6toXhWvYSy/jK3pAlrj4nN8eQrcLviPPLOeyKva9RhkzZ8LqL9Aalb3eeiMemciKEGxnS qCt8NmfQkWlG8zeLmREgIVEttyNjiyyCzFkNCl/8H/1mEiKbG4FVr6R0DViwCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1699487343; 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=Hzj/RqFQqfBRSUcxouQxkQID9aiYmCvSyWtdlVpf1dA=; b=t2Ztow5X96wNCc2i/g3nINKFjHWATTkkC7cFJ/kDfzIp77+vUd2BWdrfYHU/PYlO4cXd8l OmaOK9WyvGqDO8r+wSVb67XXcpFLpjQ+nfwaUGne7d3ZijZkE7JWFEyuP8kz+qftKRlUNn xQ02HGFGq8aahfJvOWrFeWdRhJ33IUqLXg28oWhVYXO/tUcfoxbrDAgW8uiQ/RpBv/r5CI 13Eed4Bbu5oaLdKavpzwwA2ZtsT05zkRBLxRz9VUzwMXgT08uSwrZjMVIIpjhkeMFatIR5 sxknNRLQ3nkxSW4lFW6AgcSqYtOmFJPAU4QMHwaV4zwy6fuL0jjVT1rXoe4ANw== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1699487343; a=rsa-sha256; cv=none; b=fH4pIuHwaL3ikVSqy9B31Z2tU075VXyCNeMmRkKH2un800K9nO9v28YBGo1yUZa9EznVBz rR4R8rrq2ZXKdXhpvBOhuUWar/naJh47CsdDpcR5D0KRCK2JuZaXxBUZufc8xhIDuHj+jz 82coGWC4Ct81KdiS9XzkUlOOOQr8geXa1DDvSMQ8007uo31XaoZ/uerIdBacytGoJTs7bN mX/kThWGviIa6JyKFAY0E5l8kexysGKzMeDzsq626FSlqf1PBNUEBJt6m2ZDwsS5puJOfd vmiLyWO+aimm+vKNvLpKTnCtpdg65uc3rLTffwEYxRsx5MPqvXMjPElgVsG2Lw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Thu, 9 Nov 2023 01:48:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ResourceOwner refactoring Content-Language: en-US To: Alexander Lakhin , Peter Eisentraut , Andres Freund Cc: Aleksander Alekseev , "pgsql-hackers@postgresql.org" , Julien Rouhaud , Robert Haas References: <2e10b71b-352e-b97b-1e47-658e2669cecb@iki.fi> <20221101001523.lsgmohl6fjwppbgx@awork3.anarazel.de> <9a3245db-ca03-4a47-5706-73404cfe5108@iki.fi> <20221101154251.64vyq7wy6w7aykrn@awork3.anarazel.de> <527af829-4a03-03b0-121c-46ff79c61887@iki.fi> <20230710191446.pn5ltm73t2i3xtxz@awork3.anarazel.de> <20607b96-b275-4a57-8509-29a3ed320d3f@iki.fi> <48b16f57-4204-4bd2-ab42-fb24144649c4@eisentraut.org> <9cb1277d-aee4-6511-44ee-7924676f7756@gmail.com> <599c6674-d40b-4b31-9251-c5c073ff9fdc@iki.fi> From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 08/11/2023 20:00, Alexander Lakhin wrote: > Please look at a new assertion failure, I've managed to trigger with this script: > CREATE TABLE t( > i01 int, i02 int, i03 int, i04 int, i05 int, i06 int, i07 int, i08 int, i09 int, i10 int, > i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17 int, i18 int, i19 int, i20 int, > i21 int, i22 int, i23 int, i24 int, i25 int, i26 int > ); > CREATE TABLE tp PARTITION OF t FOR VALUES IN (1); > > (gdb) bt > ... > #5  0x0000560dd4e42f77 in ExceptionalCondition (conditionName=0x560dd5059fbc "owner->narr == 0", fileName=0x560dd5059e31 > "resowner.c", lineNumber=362) at assert.c:66 > #6  0x0000560dd4e93cbd in ResourceOwnerReleaseAll (owner=0x560dd69cebd0, phase=RESOURCE_RELEASE_BEFORE_LOCKS, > printLeakWarnings=false) at resowner.c:362 > #7  0x0000560dd4e92e22 in ResourceOwnerReleaseInternal (owner=0x560dd69cebd0, phase=RESOURCE_RELEASE_BEFORE_LOCKS, > isCommit=false, isTopLevel=true) at resowner.c:725 > #8  0x0000560dd4e92d42 in ResourceOwnerReleaseInternal (owner=0x560dd69ce3f8, phase=RESOURCE_RELEASE_BEFORE_LOCKS, > isCommit=false, isTopLevel=true) at resowner.c:678 > #9  0x0000560dd4e92cdb in ResourceOwnerRelease (owner=0x560dd69ce3f8, phase=RESOURCE_RELEASE_BEFORE_LOCKS, > isCommit=false, isTopLevel=true) at resowner.c:652 > #10 0x0000560dd47316ef in AbortTransaction () at xact.c:2848 > #11 0x0000560dd47329ac in AbortCurrentTransaction () at xact.c:3339 > #12 0x0000560dd4c37284 in PostgresMain (dbname=0x560dd69779f0 "regression", username=0x560dd69779d8 "law") at > postgres.c:4370 > ... Thanks for the testing! Fixed. I introduced that bug in one of the last revisions of the patch: I changed ResourceOwnerSort() to not bother moving all the elements from the array to the hash table if the hash table is allocated but empty. However, ResourceOwnerReleas() didn't get the memo, and still checked "owner->hash != NULL" rather than "owner->nhash == 0". -- Heikki Linnakangas Neon (https://neon.tech)