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 1gvjIQ-0002rP-05 for pgsql-general@arkaria.postgresql.org; Mon, 18 Feb 2019 13:49:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvjIO-0007qp-Oi for pgsql-general@arkaria.postgresql.org; Mon, 18 Feb 2019 13:49: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 1gvjIO-0007pt-DR for pgsql-general@lists.postgresql.org; Mon, 18 Feb 2019 13:49:20 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gvjIL-0001n6-Tl for pgsql-general@lists.postgresql.org; Mon, 18 Feb 2019 13:49:20 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 58E2521C7A7A; Mon, 18 Feb 2019 16:49:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.237] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 33DC821C7A78; Mon, 18 Feb 2019 16:49:17 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1550497757; bh=RxQJR0evIJujpOjqYTq1J+0IBG4bbTqBju0AMf0frgc=; h=Subject:To:References:From:Date:In-Reply-To; b=OxPhTVDmdIJO20e0xNmvyUJ4OP47tQZC0WGgK4jVZPZ0NgUpFi151E47pr5fivcFc 3NrQULoWp2+2cYTfvfk05BW6nA1ABHQBBLkF863vNilsKGnho1xODhCg2EOLWhRl5I yiaTW8Gm+JUyEw+teKJS8eEsAKByJzP2HASV3vCo= Subject: Re: Cannot vacuum even in single-user mode after xidStopLimit is reached To: Jahwan Kim , pgsql-general@lists.postgresql.org References: From: Arthur Zakirov Message-ID: <66439d0a-d00e-ca55-cad4-04925314be7e@postgrespro.ru> Date: Mon, 18 Feb 2019 16:49:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, On 18.02.2019 15:05, Jahwan Kim wrote: > So apparently I'm in some loop without any clear way out. > The most similar thing I found was "Could not finish anti-wraparound > VACUUM when stop limit is reached" > https://www.postgresql.org/message-id/53820ED9.3010003@vmware.com. This > is quite old, though. > > Two questions: > > (1) Can I revive this database? > (2) How did this possibly happen? 1 - I think yes. But you need to drop *ALL* (in all bases) temporary tables manually and only then do VACUUM (in single mode of course). Unfortunately VACUUM do not drop and vacuum orphan temporary tables. 2 - I think you have a long lived session with long lived temporary tables. Autovacuum do not freeze temporary tables and it cannot move relfrozenxid. That's why you get wraparound. To avoid it you need to drop unnecessary temporary tables or do VACUUM in a long lived session. -- Arthur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company