pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Cleanup of same archive used by multiple standbys
4+ messages / 2 participants
[nested] [flat]

* Cleanup of same archive used by multiple standbys
@ 2011-08-10 16:41  A J <s5aly@yahoo.com>
  0 siblings, 2 replies; 4+ messages in thread

From: A J @ 2011-08-10 16:41 UTC (permalink / raw)
  To: pgsql-admin

What is the suggested technique for cleaning up an archive location shared by multiple standbys. Looks like pg_archivecleanup cannot be used as %r refers to last restartpoint of only a single standby server.
Do I need to create a custom script that somehow determines the latest common restartpoint of ALL the standbys and then manually run pg_archivecleanup with that value ?

Thanks.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Cleanup of same archive used by multiple standbys
@ 2011-08-10 16:53  A J <s5aly@yahoo.com>
  parent: A J <s5aly@yahoo.com>
  1 sibling, 1 reply; 4+ messages in thread

From: A J @ 2011-08-10 16:53 UTC (permalink / raw)
  To: pgsql-admin

Also couple of additional related question:
2. Am I correct in my assumption that if for some reason archive is not cleaned up and runs out of space, the WALs will accumulate in pg_xlog directory on the primary. If pg_xlog was to then run out of space, Primary server will stop accepting new writes and fail ?

3. If my standbys are in different datacenter, what is the suggested location of the archive directory ? Is it recommended to have it local in the data center of the primary server or somehow have it over in the remote data center.

Thanks for any pointers.


________________________________
From: A J <s5aly@yahoo.com>
To: PG Admin <pgsql-admin@postgresql.org>
Sent: Wednesday, August 10, 2011 12:41 PM
Subject: Cleanup of same archive used by multiple standbys


What is the suggested technique for cleaning up an archive location shared by multiple standbys. Looks like pg_archivecleanup cannot be used as %r refers to last restartpoint of only a single standby server.
Do I need to create a custom script that somehow determines the latest common restartpoint of ALL the standbys and then manually run pg_archivecleanup with that value ?

Thanks.

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Cleanup of same archive used by multiple standbys
@ 2011-08-10 16:53  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: A J <s5aly@yahoo.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Kevin Grittner @ 2011-08-10 16:53 UTC (permalink / raw)
  To: pgsql-admin; A J <s5aly@yahoo.com>

A J <s5aly@yahoo.com> wrote:
 
> What is the suggested technique for cleaning up an archive
> location shared by multiple standbys. Looks like pg_archivecleanup
> cannot be used as %r refers to last restartpoint of only a single
> standby server.  Do I need to create a custom script that somehow
> determines the latest common restartpoint of ALL the standbys and
> then manually run pg_archivecleanup with that value ?
 
I seem to remember that in a previous discussion of this the best
idea seemed to be to create a hard link to the file for each
standby, such that when the last standby cleans up the file, it is
actually deleted.
 
-Kevin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Cleanup of same archive used by multiple standbys
@ 2011-08-10 17:00  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: A J <s5aly@yahoo.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Kevin Grittner @ 2011-08-10 17:00 UTC (permalink / raw)
  To: pgsql-admin; A J <s5aly@yahoo.com>

A J <s5aly@yahoo.com> wrote:
 
> Also couple of additional related question:
> 2. Am I correct in my assumption that if for some reason archive
> is not cleaned up and runs out of space, the WALs will accumulate
> in pg_xlog directory on the primary. If pg_xlog was to then run
> out of space, Primary server will stop accepting new writes and
> fail ?
 
That sounds correct to me.  I've never seen it in practice, though;
we would need to ignore alerts from our monitoring for quite some
time before it got to that point.
 
> 3. If my standbys are in different datacenter, what is the
> suggested location of the archive directory ? Is it recommended to
> have it local in the data center of the primary server or somehow
> have it over in the remote data center.
 
In our shop we have found it advantageous to immediately write it
locally, and then use rsync (through ssh and a daemon) to bring the
remote site(s) into sync.
 
-Kevin



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-08-10 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 16:41 Cleanup of same archive used by multiple standbys A J <s5aly@yahoo.com>
2011-08-10 16:53 ` A J <s5aly@yahoo.com>
2011-08-10 17:00   ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2011-08-10 16:53 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>

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