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 1jQugg-0006ZE-7h for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2020 15:19:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQuge-0000mB-Qs for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2020 15:19:48 +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 1jQuge-0000m4-HK for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2020 15:19:48 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQugb-0003HH-4l for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2020 15:19:47 +0000 Received: by mail-qt1-x842.google.com with SMTP id c16so11884509qtv.1 for ; Tue, 21 Apr 2020 08:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YhlxLc/4tMIyqsRRO7VW0OxxxyJ/oMcs7Gy6QskkF0E=; b=mf+BDUBysDZBhlkqIFUdw0V/+sqCeN06DyLQM0yOGwFdqmV/ynadFTo9Q7PoN28cIU RV1yg5w7JVJ+N8LUjGCZnSo4GuR3IrOHPbxN/VibwUSX4Rtmw3AMeZVr9E5pz8aKrZc5 B3bB76u8rnBxLxonSaZKd+CrsBXWLRH6dxhMwTYIGEJ03REYQukBW724uMqLI9ivthVu zDD4WVQcgrlvmYmE7xIU62qOGGUCL4d+MP+CBmY0VfnaRN4SVIK0ZSpO6I6WIyjqJSz+ HZMaqPKaJHDwzkUC3Y0/6OW0DFHOxUBagvDD4AeV/6itUTaLHtHK/W5408Hi7VALlw9K QRVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=YhlxLc/4tMIyqsRRO7VW0OxxxyJ/oMcs7Gy6QskkF0E=; b=gYFPIAWShMbLk19FvBnlIjujvh/KWjZdH40It9kBRyeROhDiQI+LxwMJNNPFsZPwzh udZYiIx/ItGPxdCCmSCN4aLID+LLBKxpCK0keWW/fBln343/tOXw5f8tYZYyfp3//E2H GjkzZ7VtGl/r2/zk6dNGCKr2Dak8GYOdhs/RsHYnBYIaisj907dMss8TaVSNtrOSsEsE 9E3nAfaVG8NNehRfVbxNU4Q+qUAINu7m1CQs8jrQkGeVab8RlN1NIaPqN0VQ+n35KV7K 2b+3pMhhJEHbI4Q8ctkfvF/IpN3BM1gcZE7DYA+LX23kOrW2ZHxFGx10dS+0xjT8eW0+ Xhyg== X-Gm-Message-State: AGi0PuadxyckLOIWSal2sQgmPCoGvfCImKr5h2z1imN6JHCO7+JtD7Qq Y7uDON6SeIoC5rRgXUAVoi5sOg== X-Google-Smtp-Source: APiQypJNBgfgUXwvX1UhWFEPwCc4X8KvtYhtzuhJhw1Pb2Cd6NVzfsMMYo/F5UD4E4YLnoYDWjGC1w== X-Received: by 2002:ac8:1b6a:: with SMTP id p39mr21422873qtk.158.1587482382728; Tue, 21 Apr 2020 08:19:42 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id o68sm1887781qka.110.2020.04.21.08.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 08:19:42 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 2AA3D301985; Tue, 21 Apr 2020 11:19:35 -0400 (-04) Date: Tue, 21 Apr 2020 11:19:35 -0400 From: Alvaro Herrera To: Tom Lane Cc: cbw , pgsql-bugs@lists.postgresql.org Subject: Re: Backend stuck in tirigger.c:afterTriggerInvokeEvents forever Message-ID: <20200421151935.GA18772@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <26195.1587480265@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Apr-21, Tom Lane wrote: > A variant of that theory is that foreign key trigger firings are being > skipped in one case but not the other; but offhand I think those > optimizations only apply to update/delete cases not inserts. Anyway > that still requires some assumptions about moving parts that you > haven't shown us. I wonder if there are any funny interactions between trigger tuple acquisition and the ON CONFLICT stuff. The only thing that occurs to me to explain the fact that it only fails with the two stmts in the DO block is that the second insert can see rows as inserted by the same transaction. I would start by taking a few dozen backtraces and comparing them to see if any progress is being made. The fact that this reproduces in 11.2 would seem to discard theories about tuple table slot changes and table AM. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services