Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKtIa-0006i1-G1 for pgsql-admin@arkaria.postgresql.org; Sat, 14 Sep 2013 17:06:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VKtIZ-0005B2-Vh for pgsql-admin@arkaria.postgresql.org; Sat, 14 Sep 2013 17:06:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKtIY-0005Au-Sp for pgsql-admin@postgresql.org; Sat, 14 Sep 2013 17:06:18 +0000 Received: from nm37-vm0.bullet.mail.bf1.yahoo.com ([72.30.238.200]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKtIQ-00063E-5J for pgsql-admin@postgresql.org; Sat, 14 Sep 2013 17:06:18 +0000 Received: from [66.196.81.172] by nm37.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2013 17:06:08 -0000 Received: from [98.139.212.247] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 14 Sep 2013 17:06:08 -0000 Received: from [127.0.0.1] by omp1056.mail.bf1.yahoo.com with NNFMP; 14 Sep 2013 17:06:08 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 392429.64378.bm@omp1056.mail.bf1.yahoo.com Received: (qmail 6901 invoked by uid 60001); 14 Sep 2013 17:06:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1379178368; bh=0Y6nXr+TpjjDemfKrxfaT6tdanDec/gOyXxkqVqvnwM=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ASCR8bGYely53EDATMAKYRlHXl3EI57SgqXztBXzwlgTaI3VCYdoQqbT+Yt1KBt0gEmxMXBZgk2XHBqeZA7ebq3qI9No9a+iVP4J+1WUA9H3S24NolMciFIAUU786JRkKa30heKrYPIYj2KQYt29RvPqIjCHBA3Rrorjutdbr20= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=hbJIbSJgp13FatKMcdUdYO2QROPcJy9yTezoNJ9AcS3oMq2h4+/72xQ5m/jSWIYPn7PBgRxbFVxkJOdEo6jAE7Gz8vxA5wlHZi0cVi+vEz/wPofBOhqsi2alhKxtdm3uaG8wPtgrUTvrDj8SSOwko4D+xcc/Xt3SDoeUd0Nk1b8=; X-YMail-OSG: izwt_2UVM1k7IAr2qCMyW0o1ZiL_d8E.2JnDJTHAleJY1wk vQCFS1WqbFifVAgKfQ8HbByzTjObkeMKd2JrojVOy9wAAVAKBMrP6neIgm4W 9ZKl9O.pFkVbdyNVEK6gunTwvmRuDcNOhYr3qwDhtne2kHwcsOFGWyNy9ujk INCK32fIgB750PtaqsAwxnRe8mDqGGXAvchXRFxW2tJ7u0iNVE4vjKRWsGXk CWfN6b1knuRY70nFv85TXK7p8wqNLluPjH7AkQ8cVwGPcOAlG_b0zujRTnhT Vyi7hveMxnYF.vEpr7Dxg.UKYTmZOvSxO60spvT6K9_iqf51FBTdYb451h3l 9Spa5qAIJ33anrBQMLQwqHM6p71hd80RFx2j8OdPP7QhG.RxD7MLTqt5MSSW g2D0QlG_AIZzdlXSUJsu7DWLdUAoe.oaOXuaIhmDcDXUNCLyLfmLwQy79oKO vojhPnErRzw9iiUULReN7prN2bL82hhoHw1TtzmI3ciLwPres8h.gzQ93u4m 6hVmIha7Bwm29dItCV4ItL0Kg5n.i6T1WmX2_EHWtRrkUR47tGv6NRJrZK3r fb12_wDW8R6mZf.nJL8N.aAF5K86u0WISLJRiF85ETemKr7cM2r.Eg6b.EGz uOA-- Received: from [76.255.18.237] by web162901.mail.bf1.yahoo.com via HTTP; Sat, 14 Sep 2013 10:06:08 PDT X-Rocket-MIMEInfo: 002.001, UnVyYWwgSHVudGVyIDxydXJhbGh1bnRlckBnbWFpbC5jb20.IHdyb3RlOgoKPiBMZXQgbWUgcHV0IGhlcmUgdGhlIHdob2xlIHNjZW5hcmlvOgo.IDEuIEkgd2FzIGNhbGxlZCBieSBvdXIgYXBwbGljYXRpb24gdXNlcnMgdGhhdCBhbGwgdGhlIHVwZGF0aW5nIHdhcwo.IGZhaWxpbmcuIFNvIEkgd2VudCB0byBjaGVjayB0aGUgZGIuIEFueSB1cGRhdGUgdHJhbnNhY3Rpb24gaW5jbHVkaW5nCj4gbWFudWFsIHZhY3V1bSBpcyBibG9ja2VkIG91dCBieSB0aGUgZXJyb3IgbWVzc2FnZToKPiBFUlJPUjogZGF0YWIBMAEBAQE- X-Mailer: YahooMailWebService/0.8.157.561 References: <5233BA90.3020107@gmail.com> <20130914045519.GD5033@eldon.alvh.no-ip.org> <5233F3A9.30901@gmail.com> Message-ID: <1379178368.98727.YahooMailNeo@web162901.mail.bf1.yahoo.com> Date: Sat, 14 Sep 2013 10:06:08 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: wrong database name in error message? To: Rural Hunter , Alvaro Herrera Cc: "pgsql-admin@postgresql.org" In-Reply-To: <5233F3A9.30901@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Rural Hunter wrote: > Let me put here the whole scenario: > 1. I was called by our application users that all the updating was > failing. So I went to check the db. Any update transaction including > manual vacuum is blocked out by the error message: > ERROR: database is not accepting commands to avoid wraparound data loss > in database "db1" >=C2=A0=C2=A0 Suggestion=EF=BC=9AStop the postmaster and use a standalone b= ackend to > vacuum that database. > > 2. Since db1 is a very large database(it is the main db the user is > using) I can not afford to take long time to vacuum full on that. So I > thought about to try on other small dbs first. Why in the world would you want to use VACUUM FULL in this circumstance? > 3. I stop the instance. > > 4. I use "echo 'vacuum full;' | postgres --single -D /pgdata [other > dbs]" to vacuum some other dbs. I still got several warning messages > when vacuum the first database(let's say db2): > 2013-09-14 08:56:44 CST [5536]: [453-1] user=3D,db=3D,host=3D WARNING: > database "db1" must be vacuumed within 999775 transactions > 2013-09-14 08:56:44 CST [5536]: [454-1] user=3D,db=3D,host=3D HINT:=C2=A0= To avoid > a database shutdown, execute a database-wide VACUUM in that database. WARNING, not error, so the VACUUM would have run. > Here the error message still points to db1. I'm not sure which database would be referenced if the table which needed the VACUUM was a shared table, like pg_database or pg_authid. > 5.=C2=A0 When I ran the single connection vacuum on other dbs(not db1), t= here > was not any error/warning message. So I tried to start whole instance. > > 6. I started the instance and found everything is fine. > > So actually I have 3 questions here: > 1. Was the db name in the error message wrong? Probably not, to the extent that running VACUUM (FULL is not necessary) against that database would have solved the problem.=C2=A0 If it was a shared catalog table it might be that it was not the *only* database which would work. > 2. How would that happend? Shouldn't auto vacuum handle it and avoid > such problem? There are two possibilities -- either you had a long-running transaction in the cluster or your autovacuum is not configured to be aggressive enough to keep you out of trouble. > 3. How to detect such problem earlier? We would need a description of the machine (cores, RAM, storage system) and the output of these queries to be able to make good suggestions on tuning autovacuum: SELECT version(); SELECT name, current_setting(name), source =C2=A0 FROM pg_settings =C2=A0 WHERE source NOT IN ('default', 'override'); In addition, make sure that you are monitoring for long-running transactions.=C2=A0 A reasonable monitoring scheme might be to alert when either of these queries returns any rows: select * from pg_stat_activity where xact_start < (now() - interval '1 hour= '); select * from pg_prepared_xacts where prepared < (now() - interval '1 minut= e'); You can, of course, adjust the intervals to what makes the most sense for your environment.=C2=A0 If you have max_prepared_transactions set to zero, the latter query is not really necessary. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin