Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 56CAF1337B8E for ; Wed, 27 Oct 2010 04:54:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 40293-09 for ; Wed, 27 Oct 2010 07:53:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail148109.authsmtp.co.uk (outmail148109.authsmtp.co.uk [62.13.148.109]) by mail.postgresql.org (Postfix) with ESMTP id 989751337B88 for ; Wed, 27 Oct 2010 04:53:54 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id o9R7rY7A003839; Wed, 27 Oct 2010 08:53:34 +0100 (BST) Received: from [192.168.0.5] ([81.5.146.37]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id o9R7rVUU038581; Wed, 27 Oct 2010 08:53:32 +0100 (BST) Subject: Re: Simplifying replication From: Simon Riggs To: Robert Haas Cc: Josh Berkus , Greg Stark , Bruce Momjian , pgsql-hackers@postgresql.org In-Reply-To: References: <201010220022.o9M0M8Q29438@momjian.us> <4CC0DEDE.7060707@agliodbs.com> <1288096049.1587.253.camel@ebony> <4CC78781.4000206@agliodbs.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 27 Oct 2010 08:53:31 +0100 Message-ID: <1288166011.1587.1199.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: 4b69d26f-e19f-11df-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksacxtFagJbYlpF HGQLWlREUFV7XGB/ aAgfZQRDZ1RPWwN0 U09WR1pVCwUmXhVj AVx4N3xydA1DcH8+ ZERrXnAVWBZ8fBJ/ RBhJQGwPM3phaTRJ TUhYJQpJcANIfBlB agJ3XHBYLwdSbGoL PyYYHB0LBgAXEyVQ WgUMI0MTR0lDBDMk QxEJFCkuGktt X-Authentic-SMTP: 61633235383639.1015:706 X-AuthFastPath: 255 X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.419 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201010/1918 X-Sequence-Number: 172958 On Tue, 2010-10-26 at 22:03 -0400, Robert Haas wrote: > On Tue, Oct 26, 2010 at 9:59 PM, Josh Berkus wrote: > > > >> If you set wal_keep_segments=0, archive_mode=on, and > >> archive_command=, you might run out of disk space. > >> > >> If you set wal_keep_segments=-1, you might run out of disk space. > >> > >> Are you any more screwed in the second case than you are in the first > >> case? > > > > It is the same to the user either way. In either case you have to > > change some settings and restart the master. > > Except that changing wal_keep_segments doesn't require restarting the master. > > The point of allowing -1 was to allow someone to set it to that value > temporarily, to be able to do a hot backup without having to guess how > large to set it. If you don't have enough disk space for a backup to > complete, you're kind of hosed either way. You're not hosed either way. Fujii designed this carefully to avoid that and it works. The case of archive_command failing isn't comparable because that is a failure case, not a normal working server. You don't need to guess the setting of wal_keep_segments. It's a safety net that has been deliberately created to avoid the crash that would otherwise happen. I've not heard a better proposal, yet, though I too am hopeful there is a better one. This is all described in my new book on PostgreSQL Administration, available from the link below. I'm told that everything you need is also in the docs. -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services