Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSJnY-0004cj-09 for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Nov 2019 11:48:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSJnU-0003Qd-Rn for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Nov 2019 11:48:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSJnU-0003QV-Ij for pgsql-bugs@lists.postgresql.org; Wed, 06 Nov 2019 11:48:24 +0000 Received: from zimbra.optitool.de ([2001:a60:a0c8::3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSJnQ-00047D-DM for pgsql-bugs@lists.postgresql.org; Wed, 06 Nov 2019 11:48:24 +0000 Received: from zimbra.optitool.de (localhost [IPv6:::1]) by zimbra.optitool.de (Postfix) with ESMTPS id 9D546421BBA; Wed, 6 Nov 2019 12:48:16 +0100 (CET) Received: from localhost (localhost [IPv6:::1]) by zimbra.optitool.de (Postfix) with ESMTP id 8431E421A94; Wed, 6 Nov 2019 12:48:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra.optitool.de 8431E421A94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=optitool.de; s=E37AA3DA-415C-11E8-B16D-258E1F829521; t=1573040896; bh=gIEDiE99sAn1PF5aSTR9JYyVuL3aNeCWSNSGlp97t7k=; h=Date:From:To:Message-ID:MIME-Version; b=ZFYkksvqbRykGFFNyzaYS1BfcIP6tV0xqstd0a93UQQ611JEIoed3gqGJbGs/+Wbz mNoICpodc1/nJ+bT4jlnAAb/HszcZMfb2V3w0EUHlV1BHmiAW1YbvLCa3qQxhL0kws NmUBSphdpyJbtBGN3gwyy0AicBXOh7+uiBX1na0EWZ3wk+Gl6bNFj7EYK619NtAd0a +b2RSlj0WFk/HjpP//fmnZ3XxV3rOTklu57mFiQZx7hBeG+0P+sEiZ9T28vUeWT+3R Ea1KiFZJvsWOEHlqZ9vp8MeeyjipJ8fawDPOVmzhIMuikyy+Q0zQikgzGpknyKQz2B oG0eJ3Xttbngw== Received: from zimbra.optitool.de ([IPv6:::1]) by localhost (zimbra.optitool.de [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id MEf2iGPjAJfR; Wed, 6 Nov 2019 12:48:16 +0100 (CET) Received: from zimbra.optitool.de (localhost [127.0.0.1]) by zimbra.optitool.de (Postfix) with ESMTP id 6950D4219A5 for ; Wed, 6 Nov 2019 12:48:16 +0100 (CET) Date: Wed, 6 Nov 2019 12:48:16 +0100 (CET) From: Thomas Butz To: pgsql-bugs@lists.postgresql.org Message-ID: <1820932263.377949.1573040896379.JavaMail.zimbra@optitool.de> Subject: Re: BUG #16095: Segfault while executing trigger MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_4d20ad18-dd69-4fa9-8343-2da812728780" X-Originating-IP: [2001:a60:a0c8:100:47ef:5fd3:bc93:5baf] X-Mailer: Zimbra 8.8.15_GA_3829 (ZimbraWebClient - FF70 (Linux)/8.8.15_GA_3829) Thread-Index: 6LEkIWlFBcPeJwq6KTQ9vTadmqA/+A== Thread-Topic: BUG #16095: Segfault while executing trigger List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --=_4d20ad18-dd69-4fa9-8343-2da812728780 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit > Thomas, can you try with that patch and see if it fixes the problem > for you? We're quite close to 12.1 release, so if there's more to fix, > it'd be better to find out ASAP. > > Note that this theory requires that the query we see being executed within > a BEFORE UPDATE trigger had itself fired a BEFORE UPDATE trigger, and that > there'd been concurrent commits causing EPQ to run. That doesn't seem > exactly implausible, but it's data not evident in your report. That seems to be the case because the software is running parallel UPDATE requests against a table called "placex" which has an active trigger[1]: CREATE TRIGGER placex_before_update BEFORE UPDATE ON placex FOR EACH ROW EXECUTE PROCEDURE placex_update(); and the placex_update() function is again issuing UPDATE statements[2]: UPDATE placex set linked_place_id = null, indexed_status = 2 where linked_place_id = NEW.place_id; [1] https://github.com/openstreetmap/Nominatim/blob/65daef70c1f9aa80e6d37fc12198309e49b883ca/sql/tables.sql#L198-L199 [2] https://github.com/openstreetmap/Nominatim/blob/05d7f9139247981cc7d9edc1edca9492e94b516b/sql/functions.sql#L1248-L1249 Are there any prebuilt deb packages with this patch? Kind regards Thomas Butz --=_4d20ad18-dd69-4fa9-8343-2da812728780 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
> Thomas= , can you try with that patch and see if it fixes the problem
> for y= ou?  We're quite close to 12.1 release, so if there's more to fix,
= > it'd be better to find out ASAP.
>
> Note that this theor= y requires that the query we see being executed within
> a BEFORE UPD= ATE trigger had itself fired a BEFORE UPDATE trigger, and that
> ther= e'd been concurrent commits causing EPQ to run.  That doesn't seem
= > exactly implausible, but it's data not evident in your report.

= That seems to be the case because the software is running parallel UPDATE r= equests against a table called "placex" which has an active trigger[1]:
=

CREATE TRIGGER placex_before_update BEFORE UPDATE ON placex
&nbs= p;   FOR EACH ROW EXECUTE PROCEDURE placex_update();


a= nd the placex_update() function is again issuing UPDATE statements[2]:
<= br>
UPDATE placex set linked_place_id =3D null, indexed_status =3D 2
=     where linked_place_id =3D NEW.place_id;


[1] h= ttps://github.com/openstreetmap/Nominatim/blob/65daef70c1f9aa80e6d37fc12198= 309e49b883ca/sql/tables.sql#L198-L199
[2] https://github.com/openstreetm= ap/Nominatim/blob/05d7f9139247981cc7d9edc1edca9492e94b516b/sql/functions.sq= l#L1248-L1249


Are there any prebuilt deb packages with this patc= h?



Kind regards

Thomas Butz
--=_4d20ad18-dd69-4fa9-8343-2da812728780--