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 1kIiah-00064X-QY for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Sep 2020 01:20:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIiag-0005vY-Og for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Sep 2020 01:20:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIiag-0005vR-Ii for pgsql-bugs@lists.postgresql.org; Thu, 17 Sep 2020 01:20:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIiaa-0003W0-PJ for pgsql-bugs@lists.postgresql.org; Thu, 17 Sep 2020 01:20:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08H1JsHh098504; Wed, 16 Sep 2020 21:19:54 -0400 From: Tom Lane To: Max Vikharev cc: PostgreSQL mailing lists Subject: Re: BUG #16620: Autovacuum does not process certain databases after migration from postgresql 10 In-reply-to: References: <16620-57ee4c2e1b7b5fef@postgresql.org> Comments: In-reply-to Max Vikharev message dated "Wed, 16 Sep 2020 23:50:25 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <98502.1600305594.1@sss.pgh.pa.us> Date: Wed, 16 Sep 2020 21:19:54 -0400 Message-ID: <98503.1600305594@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Max Vikharev writes: > Problem gone after restarting the cluster. > Autovacuum started to process relations in other databases. Hmm, interesting. > I dont know how to reproduce the issue, we will monitor it. > If there any way to debug it when it occurs again - let me know. Did you by any chance capture the contents of pg_database.datfrozenxid and datminmxid and compare them to the pg_class.relfrozenxid and relminmxid fields in the problematic databases? It's not hard to imagine that if the pg_database fields somehow didn't get updated correctly during pg_upgrade, that would prevent autovacuum from processing some databases to prevent wraparound. However, that doesn't explain failure to examine those databases at all, so I'm a bit at a loss. Another thing to check is whether the stats collector is working. Specifically look at whether counts in pg_stat_all_tables are incrementing in the problem databases. My guess is that somehow pg_upgrade left something in a slightly hosed state, and that restarting de-hosed it, so that you aren't going to see this again ... at least not till your next upgrade. But I don't know exactly what the something could be. regards, tom lane