Re: Hard limit on WAL space used (because PANIC sucks)

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hard limit on WAL space used (because PANIC sucks)
Date: 2013-06-11 01:06:49
Message-ID: 51B67829.1010502@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> Not a bad idea. One that supports rsync and another that supports
> robocopy. That should cover every platform we support.

Example script:

=============================

#!/usr/bin/env bash

# Simple script to copy WAL archives from one server to another
# to be called as archive_command (call this as wal_archive "%p" "%f")

# Settings. Please change the below to match your configuration.

# holding directory for the archived log files on the replica
# this is NOT pg_xlog:
WALDIR="/var/lib/pgsql/archive_logs"

# touch file to shut off archiving in case of filling up the disk:
NOARCHIVE="/var/lib/pgsql/NOARCHIVE"

# replica IP, IPv6 or DNS address:
REPLICA="192.168.1.3"

# put any special SSH options here,
# and the location of RSYNC:
export RSYNC_RSH="ssh"
RSYNC="/usr/bin/rsync"

######## DO NOT CHANGE THINGS BELOW THIS LINE ##########

SOURCE="$1" # %p
FILE="$2" # %f
DEST="${WALDIR}/${FILE}"

# See whether we want all archiving off
test -f ${NOARCHIVE} && exit 0

# Copy the file to the spool area on the replica, error out if
# the transfer fails
${RSYNC} --quiet --archive --rsync-path=${RSYNC} ${SOURCE} \
${REPLICA}:${DEST}

if [ $? -ne 0 ]; then
exit 1
fi

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2013-06-11 03:15:09 Re: Re: [COMMITTERS] pgsql: Don't downcase non-ascii identifier chars in multi-byte encoding
Previous Message Michael Paquier 2013-06-11 00:49:13 Re: Parallell Optimizer