Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id ED61EB5DBD0 for ; Thu, 30 Jun 2011 14:05:55 -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 18507-07 for ; Thu, 30 Jun 2011 17:05:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id 4A9A5B5DBC9 for ; Thu, 30 Jun 2011 14:05:49 -0300 (ADT) Received: by pzk9 with SMTP id 9so1899857pzk.19 for ; Thu, 30 Jun 2011 10:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=kWxh/PyaRX6CkU2dmx4OGnab6GufNZ9vi5hY1XPOJkY=; b=oDocnbaP2n7XjAIkMmdZI8ixYm02+JOfq7B7dQcH8BbscVOGgTqJAI3VwzV3B0Ehc+ foEAA8WKxqqyn77irAVlc6W34SJjq4PWLUI3Wl7t6kzPZb0sOCo3T5rthFvQ4gJEpBNi q/jIlro103mBqTz0tqkWNdqdjdbxgCpUcxVVg= MIME-Version: 1.0 Received: by 10.68.41.136 with SMTP id f8mr2988200pbl.243.1309453548504; Thu, 30 Jun 2011 10:05:48 -0700 (PDT) Received: by 10.68.43.67 with HTTP; Thu, 30 Jun 2011 10:05:48 -0700 (PDT) In-Reply-To: <4E0CABC3.7000101@agliodbs.com> References: <26007.1303309175@sss.pgh.pa.us> <27149.1303312506@sss.pgh.pa.us> <4E0BD74B.7020105@agliodbs.com> <4E0CABC3.7000101@agliodbs.com> Date: Thu, 30 Jun 2011 13:05:48 -0400 Message-ID: Subject: Re: time-delayed standbys From: Robert Haas To: Josh Berkus Cc: pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201106/2368 X-Sequence-Number: 191081 On Thu, Jun 30, 2011 at 1:00 PM, Josh Berkus wrote: > On 6/30/11 2:00 AM, Simon Riggs wrote: >>>> Manual (or scripted) intervention is always necessary if you reach dis= k >>>> >> 100% full. >>> > >>> > Wow, that's a pretty crappy failure mode... but I don't think we need >>> > to fix it just on account of this patch. =A0It would be nice to fix, = of >>> > course. >> How is that different to running out of space in the main database? >> >> If I try to pour a pint of milk into a small cup, I don't blame the cup. > > I have to agree with Simon here. =A0;-) > > We can do some things to make this easier for administrators, but > there's no way to "solve" the problem. =A0And the things we could do woul= d > have to be advanced optional modes which aren't on by default, so they > wouldn't really help the DBA with poor planning skills. =A0Here's my > suggestions: > > 1) Have a utility (pg_archivecleanup?) which checks if we have more than > a specific settings's worth of archive_logs, and breaks replication and > deletes the archive logs if we hit that number. =A0This would also requir= e > some way for the standby to stop replicating *without* becoming a > standalone server, which I don't think we currently have. > > 2) Have a setting where, regardless of standby_delay settings, the > standby will interrupt any running queries and start applying logs as > fast as possible if it hits a certain number of unapplied archive logs. > =A0Of course, given the issues we had with standby_delay, I'm not sure I > want to complicate it further. > > I think we've already fixed the biggest issue in 9.1, since we now have > a limit on the number of WALs the master will keep if archiving is > failing ... yes? =A0That's the only big *avoidable* failure mode we have, > where a failing standby effectively shuts down the master. I'm not sure we changed anything in this area for 9.1. Am I wrong? wal_keep_segments was present in 9.0. Using that instead of archiving is a reasonable way to bound the amount of disk space that can get used, at the cost of possibly needing to rebuild the standby if things get too far behind. Of course, in any version, you could also use an archive_command that will remove old files to make space if the disk is full, with the same downside: if the standby isn't done with those files, you're now in for a rebuild. --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company