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 1sEnp7-003ixU-VV for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2024 10:24:55 +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 1sEnp7-007Vwl-Ib for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Jun 2024 10:24:53 +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 1sEnp7-007Vwd-8E for pgsql-bugs@lists.postgresql.org; Wed, 05 Jun 2024 10:24:53 +0000 Received: from mx0a-00134001.pphosted.com ([205.220.160.129]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEnp4-003Z5c-BL for pgsql-bugs@lists.postgresql.org; Wed, 05 Jun 2024 10:24:51 +0000 Received: from pps.filterd (m0267959.ppops.net [127.0.0.1]) by mx0a-00134001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4558PbcN029279; Wed, 5 Jun 2024 10:24:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=optiver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=mail; bh=OV8NB dUZdu/3qNTNMV36KGNM+uKkSNyflLFtUM6URnA=; b=u0N1qCWN1GsKBoXnZ/Wck WtAAeDPlWQ6f+6w97LMuSXlTq+vNA/BHK/v9SYicGI5OBDOi6mYho9DfmI8UIXef rGlJqvLrDU8+Yd9FzSH1ovpHEyJ7a68bl2hLL/yrjl5gBC1AjY9HxpUNbjUJ2MbY 21UfU5d3axgtwpIBSOKhKprhQ4Y+FvpMXvNmxlVtWsNBsrtT4c3lNWohc25+FGzP 9q1g+Bk6RFmiyMCkJiO4lsVYhA1XFS+TZblJjYUvO1cfxTde3bEk2UkZMuoWCMRZ thsLU17jPl80mzWwU+auJZJeUs4BDffsOIMDD7sQFsFwJj5QPIQFHnIJ6cTcwYAB g== Received: from opammb1268.comp.optiver.com ([195.246.114.78]) by mx0a-00134001.pphosted.com (PPS) with ESMTPS id 3yjmge84x1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 10:24:46 +0000 (GMT) Received: from opammb1267.comp.optiver.com (100.68.11.12) by opammb1268.comp.optiver.com (100.68.11.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 5 Jun 2024 12:24:43 +0200 Received: from opammb1267.comp.optiver.com ([fe80::5b6f:1976:98cd:68a7]) by opammb1267.comp.optiver.com ([fe80::5b6f:1976:98cd:68a7%13]) with mapi id 15.02.1118.026; Wed, 5 Jun 2024 12:24:43 +0200 From: Floris Van Nee To: Michael Paquier CC: Andres Freund , Kyotaro Horiguchi , "exclusion@gmail.com" , "pgsql-bugs@lists.postgresql.org" Thread-Topic: [External] Re: BUG #17947: Combination of replslots pgstat issues causes error/assertion failure [External] Thread-Index: AQHZlBmhKd6ff+auW0KpzehwxH4Xw7GK7OSAgCxGHICAAgJ4gIACBjBQ Date: Wed, 5 Jun 2024 10:24:43 +0000 Message-ID: References: <17947-b9554521ad963c9c@postgresql.org> <20230601.084245.1524588196504400333.horikyota.ntt@gmail.com> <20240505183741.5tefii3razzefvtc@awork3.anarazel.de> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [100.68.31.122] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: BUG #17947: Combination of replslots pgstat issues causes error/assertion failure X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_11,2024-06-05_02,2024-05-17_01 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >=20 > Note an extra edge case in pgstat_init_function_usage(), which should do > the same, I guess? >=20 I noticed it but wasn't sure if it was necessary here due to the exceptiona= l case here. It raises ereport error right after and can only reach this if the entry wa= s created In the call to pgstat_prep_pending_entry before it, so it seems unlikely an= other backend holds a ref to it. I might be wrong though. > Attached is an updated patch with refined comments at the top of ? > pgstat_drop_entry(), to be applied to 15~. Thanks for testing the patch. Updated patch looks good to me. -Floris