Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VM2AR-00053c-Ce for pgsql-admin@arkaria.postgresql.org; Tue, 17 Sep 2013 20:46:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VM2AQ-0002Ug-Nu for pgsql-admin@arkaria.postgresql.org; Tue, 17 Sep 2013 20:46:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VM2AP-0002Ua-Rh for pgsql-admin@postgresql.org; Tue, 17 Sep 2013 20:46:38 +0000 Received: from nm2-vm1.bullet.mail.bf1.yahoo.com ([98.139.213.158]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VM2A7-0002CP-7j for pgsql-admin@postgresql.org; Tue, 17 Sep 2013 20:46:37 +0000 Received: from [98.139.212.145] by nm2.bullet.mail.bf1.yahoo.com with NNFMP; 17 Sep 2013 20:46:17 -0000 Received: from [98.139.212.247] by tm2.bullet.mail.bf1.yahoo.com with NNFMP; 17 Sep 2013 20:46:17 -0000 Received: from [127.0.0.1] by omp1056.mail.bf1.yahoo.com with NNFMP; 17 Sep 2013 20:46:17 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 747262.43960.bm@omp1056.mail.bf1.yahoo.com Received: (qmail 46308 invoked by uid 60001); 17 Sep 2013 20:46:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1379450777; bh=u85odxvnCVR8Ra/+ExP+HJldOg2kyx/i2jtwx0v/j70=; 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=EKhgPALBVuhiL5Ddt0ORbykVyaskNzd2f/cSQNb95rLNfoN1Dy2xBL/qGYk7h2hfVLC8SxCrWgOHMy7+cFH/vR9J9oH6brkLg/O6ZP57VQxXw43TFQ3AWMw+OKJQOycxB4/CnPtTdc4Cgi7NxMPV1A4/fc1Q2aJ7D1kT6KUOSqw= 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=IjxGCtNLO63m/A1EAyQPAXHkgJOx9NfTZFs8KSl6tgdsV60BXMzMCKRCV1Fg80Yhw1HXMKKTWj9yvimvfgmm0Ci1dw3JsH9hiNx3qjCtxwhpUrKakFTphok0E98mgPOYKLU10xfDfAzu7nTAwbW3p8DRcqAPEKb8k1Mr7vWoHJY=; X-YMail-OSG: DSF3SFwVM1nk8nbOd3zqLhv3F4keQ7K7waUdhApFX0mn_7r ZE.qQl010tGTNOGGrIZp6 Received: from [76.255.18.237] by web162906.mail.bf1.yahoo.com via HTTP; Tue, 17 Sep 2013 13:46:17 PDT X-Rocket-MIMEInfo: 002.001, TmF0YWxpZSBXZW56IDxuYXRhbGlld2VuekBlYnVyZWF1LmNvbT4gd3JvdGU6Cgo.IFNvcnJ5OyBteSBkZXNjcmlwdGlvbiBvZiB3aGF0IGlzIGdvaW5nIG9uIHdhcyBhIGxpdHRsZSB1bmNsZWFyLgo.IFdlIGRpZG4ndCB1cGdyYWRlIHRoZSBleGlzdGluZyBkYXRhYmFzZS4gV2UgbW92ZWQgaXQgdG8gZGlmZmVyZW50Cj4gaGFyZHdhcmUsIGFuZCBqdXN0IGNyZWF0ZWQgYSBicmFuZCBuZXcgZGF0YWJhc2UgdG8gYWNjZXB0IHRoZQo.IGRhdGEgdGhhdCBoYWQgYmVlbiBiYWNraW5nIHVwIGluIHNxbGl0ZSBmaWwBMAEBAQE- X-Mailer: YahooMailWebService/0.8.157.561 References: <1379421830.30619.YahooMailNeo@web162902.mail.bf1.yahoo.com> Message-ID: <1379450777.26197.YahooMailNeo@web162906.mail.bf1.yahoo.com> Date: Tue, 17 Sep 2013 13:46:17 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: Dumping a database that is not accepting commands? To: Natalie Wenz Cc: "pgsql-admin@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 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 Natalie Wenz wrote: > Sorry; my description of what is going on was a little unclear. > We didn't upgrade the existing database. We moved it to different > hardware, and just created a brand new database to accept the > data that had been backing up in sqlite files while our original > database was offline. I'm still dealing with the wraparound on > the original, just on a different machine. OK, to restate to be sure I understand, the original database is being vacuumed in a new location, and a new 9.3 database in the original location has absorbed the queued data?=A0 Once you complete the vacuum, you will copy the old data back to the new database at the old location? > autovacuum_freeze_max_age=A0=A0=A0=A0=A0=A0 | 800000000 > Normally the autovacuum seem to keep up sufficiently. We got into > trouble with a bad combination of not-typical long-running > queries, a disk failure and subsequent zpool repair, and the only > person who checks the log files regularly (me) was out of the > office. This has been so painful and slow to recover from, I > don't think we'll ever get into this mess again. (At least not > quite like this. I seem to have a knack for finding *new* ways to > break things.) A perfect storm of events, eh?=A0 It's hard to have things always go smoothly in the face of such events, but I see a couple things you might want to consider.=A0 Increasing autovacuum_freeze_max_age reduces the amount of time you have to get back on track.=A0 You might want to take that back down to the default.=A0 There was a bug causing wraparound prevention autovacuums to trigger too frequently, which is now fixed in the latest minor releases, so making that chnage might not be as painful as you expect.=A0 Make sure you are monitoring for long-running transactions, so you don't get burned by one that is accidental.=A0 Also, if you have a processing cycle where there are off-peak hours on a daily or weekly basis, you might want to run a VACUUM ANALYZE command durning those windows, to get some of the freezing done before it is critical. > I will also take this opportunity to mention again that if anyone > is considering a making a patch for 64-bit xids, you would make > at least one small group of people very, very happy.=A0 :) While 64-bit xids isn't likely, there is some work taking a more creatie approach to the issue which might make you even happier in a year or so.=A0 :-) > Side question: some of the longer queries that were running when > the database yakked were deletes of old data that had been > manually migrated to a new table with a more appropriate format. > We were running out of disk space, so we were trying to clear up > some space by removing data we now had in two places. Does a > delete of previously-frozen rows unfreeze them, or anything like > that? Because in a series of maybe a dozen queries or so, we > deleted billions of rows. Does that generate a significant amount > of extra work for the autovacuumer?=20 The pages which had tuples deleted would need to be cleaned up by vacuum, and rewritten.=A0 It would also remove all index entries for all deleted rows.=A0 It might also scan backward from the end of the table to release space to the OS.=A0 That could conceivably be enough avoidable work to make your idea of copying out the remaining data feasible.=A0 What percentage of the rows were deleted?=A0 Could your copy out be to a separate set of drives? If you know at the time a row is added what group it will be in for deletion, it might pay to move to partitioning, so that a group of rows could be deleted pretty much as fast as you can drop a table. -- 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