From: jayknowsunix@gmail.com
To: Doiron, Daniel <DoironD@advisory.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: WAL Archive Cleanup on Master/Standby
Date: Wed, 15 Oct 2014 12:27:35 -0400
Message-ID: <18EBD8DA-B2BE-4962-AC44-3FA7BC273803@gmail.com> (raw)
In-Reply-To: <3A8E2AE3D7AFB44F89EA82A873FBE4E6557E2CCA@DC-MBOX1.advisory.com>
References: <3A8E2AE3D7AFB44F89EA82A873FBE4E6557E2CCA@DC-MBOX1.advisory.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Daniel,
I use a custom script that I developed as we needed a reliable copy to a pair a standby servers. That script knows which WAL segment has been successfully copied to which server, and when it knows that both copies were successful, it deletes the segment from the master. However, if one of the copies failed, the WAL segment is left on the primary where it is tried again the next time it gets called. So far, it seems fairly reliable and consistent.
--
Jay
Sent from my iPad
> On Oct 15, 2014, at 12:02 PM, "Doiron, Daniel" <DoironD@advisory.com> wrote:
>
> I’m curious how others are cleaning up their WAL archive files and other miscellany created by the process.
>
> Here’s my setup:
>
> Server A: archive_command executes a script that rsync’s the archive file to a local folder and a matching folder on the standby server (does not mirror the folder, just pushes the file twice)
>
> Server B: recovery.conf archive_cleanup_command uses pg_archivecleanup to clean the standby archive folder and sends log output to a cleanup.log file
>
> What I’m left with:
> - WAL archive files on the Master server that only get cleaned up if I fail over and recover using a new pg_basebackup from Server B to Server A
> - .history and .backup files on the standby server
> - Entries in the cleanup.log file
>
> Right now, I’m thinking my cleanup will involve (every 6 months):
> - Failing over my cluster (kidding)
> - Truncating the cleanup.log file
> - ?? with .history and .backup files
>
> What are you doing?
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: jayknowsunix@gmail.com, DoironD@advisory.com
Subject: Re: WAL Archive Cleanup on Master/Standby
In-Reply-To: <18EBD8DA-B2BE-4962-AC44-3FA7BC273803@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