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 1hOR3x-0004eW-Df for pgsql-general@arkaria.postgresql.org; Wed, 08 May 2019 18:13:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hOR3v-0001S0-Ti for pgsql-general@arkaria.postgresql.org; Wed, 08 May 2019 18:13:03 +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 1hOR3v-0001Pb-I9; Wed, 08 May 2019 18:13:03 +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 1hOR3s-0005Xc-4u; Wed, 08 May 2019 18:13:02 +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 x48ICuMA021503; Wed, 8 May 2019 14:12:56 -0400 From: Tom Lane To: neeraj kumar cc: pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: Query on pg_stat_activity table got stuck In-reply-to: References: <15877.1557178386@sss.pgh.pa.us> Comments: In-reply-to neeraj kumar message dated "Wed, 08 May 2019 10:42:12 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21501.1557339176.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 08 May 2019 14:12:56 -0400 Message-ID: <21502.1557339176@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk neeraj kumar writes: > Took some time to get stack trace as we didn't had root permission. > Attaching stack trace of two process (out of many) stuck for same query > below[1][2] Hmm, the line numbers in your stack traces don't agree with either v10 or HEAD branches for me. But assuming that you've correctly identified where it's stuck: > Seems like call is unable to come out of this loop : > https://github.com/postgres/postgres/blob/master/src/backend/postmaster/= pgstat.c#L3361-L3400 the only really obvious theory is that some process left its st_changecount odd, which would more or less have to imply that something threw an error between pgstat_increment_changecount_before and pgstat_increment_changecount_after. There's only one place where that seems very plausible, namely pgstat_bestart, which is doing a rather scary amount of stuff in between. Are you using either SSL or GSS? regards, tom lane