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 1gPs3a-0004CE-HH for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Nov 2018 16:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gPs3Y-0008WI-TH for pgsql-bugs@arkaria.postgresql.org; Thu, 22 Nov 2018 16:42:20 +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 1gPs3Y-0008W2-N1 for pgsql-bugs@lists.postgresql.org; Thu, 22 Nov 2018 16:42:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gPs3V-0001aD-Fz for pgsql-bugs@postgresql.org; Thu, 22 Nov 2018 16:42:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wAMGgEUe017401; Thu, 22 Nov 2018 11:42:14 -0500 From: Tom Lane To: Feike Steenbergen cc: PostgreSQL mailing lists Subject: Re: New sessions on a database to be dropped consume 100% cpu In-reply-to: References: Comments: In-reply-to Feike Steenbergen message dated "Thu, 22 Nov 2018 16:50:54 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17399.1542904934.1@sss.pgh.pa.us> Date: Thu, 22 Nov 2018 11:42:14 -0500 Message-ID: <17400.1542904934@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Feike Steenbergen writes: > While dropping a database, I was unable to do so because of a connected > session. I used pg_terminate_backend to try to get rid of the session, > however it is unkillable (from postgres). The stack trace shows that it's stuck trying to make index entries for some pg_depend additions. I'm wondering if one of the indexes for pg_depend is corrupt (infinite loop of page right-links, say). If you could install amcheck and see what it thinks about those indexes, that would be interesting. Of course, if you're just wishing you could get rid of the database, you could forcibly kill those processes and move on. regards, tom lane