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 1h6chH-0000kw-27 for pgsql-admin@arkaria.postgresql.org; Wed, 20 Mar 2019 15:00:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6chE-0001UN-TT for pgsql-admin@arkaria.postgresql.org; Wed, 20 Mar 2019 15:00:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6chE-0001S2-Hh for pgsql-admin@lists.postgresql.org; Wed, 20 Mar 2019 15:00:00 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6chB-00080P-0Z for pgsql-admin@lists.postgresql.org; Wed, 20 Mar 2019 14:59:59 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 6E888A3471; Wed, 20 Mar 2019 15:59:50 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id ffBEas-MlpBl; Wed, 20 Mar 2019 15:59:45 +0100 (CET) Message-ID: Subject: Re: error: database is not accepting commands to avoid wraparound data loss in database .... From: Laurenz Albe To: Josef Machytka , pgsql-admin@lists.postgresql.org Date: Wed, 20 Mar 2019 15:59:44 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2019-03-20 at 12:01 +0100, Josef Machytka wrote: > I checked solution for wraparound error and since all sources I found > suggested to do VACUUM under single-user mode I decided to test it on > second smaller data warehouse database (~16TB of data) which is not so > crucial for us to have it still running since I knew it will be inaccessible > during that time. Vacuum is running for 24 hours already on this database > and I can only wait for it to finish.... > > Can I do something else with main data warehouse database than just this > painfully slow VACUUM? If I would change some settings for freeze would > it help in way that database would accept commands again so I would be > able to drop subscription and vacuum it in normal way? One this happen, all you can do it wait for the manual VACUUM to finish. Don't interrupt it. The alternative (losing your data to corruption) is more painful than this outage. If you perform database backups with pg_dump, one faster solution with little data loss would be to restore such a backup. The resulting database will not be bloated. To prevent this from happening, monitor database bloat and tune autovacuum to be more aggressive if necessary. If your load is mostly UPDATEs, see ig you can make use of the HOT update feature. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com