Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fK6lR-0007DQ-PW for pgsql-general@arkaria.postgresql.org; Sat, 19 May 2018 18:39:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fK6lQ-0005Ih-EP for pgsql-general@arkaria.postgresql.org; Sat, 19 May 2018 18:39:32 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fK6lQ-0005IW-6f for pgsql-general@lists.postgresql.org; Sat, 19 May 2018 18:39:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fK6lM-0006gJ-Vf for pgsql-general@postgresql.org; Sat, 19 May 2018 18:39:31 +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 w4JIdQdp025192; Sat, 19 May 2018 14:39:26 -0400 From: Tom Lane To: Justin Pryzby cc: pgsql-general@postgresql.org Subject: Re: postgres=# VACUUM FULL pg_statistic => ERROR: missing chunk number 0 for toast value .. in pg_toast_2619 In-reply-to: <20180519163528.GD30060@telsasoft.com> References: <20180519142603.GA30060@telsasoft.com> <26735.1526742503@sss.pgh.pa.us> <20180519162457.GC30060@telsasoft.com> <20180519163528.GD30060@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Sat, 19 May 2018 11:35:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25189.1526755166.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 19 May 2018 14:39:26 -0400 Message-ID: <25190.1526755166@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Justin Pryzby writes: > [pryzbyj@database ~]$ while :; do for db in `psql postgres -Atc "SELECT = datname FROM pg_database WHERE datallowconn"`; do for t in pg_statistic pg= _attrdef pg_constraint; do echo "$db.$t..."; PGOPTIONS=3D-cstatement_timeo= ut=3D'9s' psql $db -qc "VACUUM FULL $t"; done; done; done > ... > postgres.pg_statistic... > postgres.pg_attrdef... > postgres.pg_constraint... > template1.pg_statistic... > template1.pg_attrdef... > template1.pg_constraint... > ts.pg_statistic... > ERROR: canceling statement due to statement timeout > ts.pg_attrdef... > ts.pg_constraint... > postgres.pg_statistic... > ERROR: missing chunk number 0 for toast value 3372855171 in pg_toast_26= 19 Hm, so was the timeout error happening every time through on that table, or just occasionally, or did you provoke it somehow? I'm wondering how your 9s timeout relates to the expected completion time. I don't have any test DBs with anywhere near large enough stats to require 9s to vacuum pg_statistic, but I'm trying this with a much-reduced value of statement_timeout, and so far no failures ... regards, tom lane