pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim <elatllat@gmail.com>
To: Ben Lancaster <benlancaster@holler.co.uk>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_archivecleanup with multiple slaves
Date: Fri, 20 May 2011 07:53:53 -0400
Message-ID: <BANLkTi=yZFz+xUS27dwM1CeVAWrjSyvyfg@mail.gmail.com> (raw)
In-Reply-To: <D1FBF69C-F380-4F16-AF57-20A32CB4850C@holler.co.uk>
References: <D1FBF69C-F380-4F16-AF57-20A32CB4850C@holler.co.uk>

I think you are using Log-Shipping not Streaming-Replication
http://www.postgresql.org/docs/9.0/static/different-replication-solutions.html

I would just make 2 copies of the WAL file one for each slave in different
folders.
That way if one slave is offline for a period of time it can catch up when
it comes back online.

On Fri, May 20, 2011 at 6:59 AM, Ben Lancaster <benlancaster@holler.co.uk>wrote:

> Hi,
>
> First post, forgive me if this is better suited to pgsql-general.
>
> I've got streaming replication set up with two slave servers (PostgreSQL
> 9.0 on Ubuntu 10.04 LTS). The master pushes the WAL to an NFS export, which
> is in turn mounted on and picked up by the two slaves.
>
> The problem I have is that pg_archivecleanup (running on one of the slaves)
> was removing WAL logs before the other slave had picked up the changes, thus
> breaking replication for the second slave. As an interim fix, I simply
> disabled the automatic cleanup and figured I'd worry about it later.
>
> Well, later is now and I'm running out of HDD space. So, what's the best
> (or perhaps, correct) way to handle cleaning up WAL archives when there's
> more than one slave? My first thought was prefixing the pg_archivecleanup
> call in recovery.conf's archive_cleanup_command with a "sleep" of a few
> seconds to allow both slaves to pick up changes before WAL files are cleaned
> up, but I'm afraid I'll end up with some weird race conditions, with loads
> of sleeping processes waiting to cleanup WAL files that have previously been
> cleaned up by a recently awoken process.
>
> Thanks in advance,
>
> Ben
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

view thread (7+ messages)  latest in thread

Message-ID: <BANLkTi=yZFz+xUS27dwM1CeVAWrjSyvyfg@mail.gmail.com>
Permalink:  ../BANLkTi=yZFz+xUS27dwM1CeVAWrjSyvyfg@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTi=yZFz+xUS27dwM1CeVAWrjSyvyfg@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: elatllat@gmail.com, benlancaster@holler.co.uk
  Subject: Re: pg_archivecleanup with multiple slaves
  In-Reply-To: <BANLkTi=yZFz+xUS27dwM1CeVAWrjSyvyfg@mail.gmail.com>
  References: <D1FBF69C-F380-4F16-AF57-20A32CB4850C@holler.co.uk> <BANLkTi=yZFz+xUS27dwM1CeVAWrjSyvyfg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox