Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aOm5L-0002Mv-Vp for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Jan 2016 12:54:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aOm5L-0001m3-79 for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Jan 2016 12:54:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aOm5K-0001lw-LP for pgsql-bugs@postgresql.org; Thu, 28 Jan 2016 12:54:02 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aOm5F-0005Wa-Lb for pgsql-bugs@postgresql.org; Thu, 28 Jan 2016 12:53:59 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [194.78.224.83]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id BBAF2402A33; Thu, 28 Jan 2016 04:53:52 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 5B22650E; Thu, 28 Jan 2016 09:53:51 -0300 (CLT) Date: Thu, 28 Jan 2016 13:53:51 +0100 From: Alvaro Herrera To: dimitri@2ndQuadrant.fr Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13895: Hot Standby locked replaying auto vacuum against pg_catalog.pg_statistics Message-ID: <20160128125351.GA728572@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160128124257.2539.1850@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org dimitri@2ndQuadrant.fr wrote: > > I witnessed a case where I had no time to extract information about it, so > it's all from memory, sorry about that. > > We had several Hot Standby nodes in 9.3.x used for load balancing read only > queries. All queries were stuck, and pg_locks showed they were refused a > lock against pg_catalog.pg_statistics. My WAG is that this is related to the standby replaying the AccessExclusive lock obtained to truncate pg_statistics. That seems consistent with the presented symptoms. I would have assumed that the actual truncation shouldn't take a particularly long time, so user processes on the standby wouldn't be locked for long enough to cause visible trouble. Maybe the table was originally very bloated and a lot of pages got removed, leading the replay process to take some time. It is strange that it would be locked for long enough to allow for manually querying pg_locks and pg_stat_activity. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs