Backing up the currently used wal segment

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Backing up the currently used wal segment
Date: 2006-07-06 16:39:53
Message-ID: 44AD3CD9.3090702@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

I've implemented replication to a warm standby using wal
logshipping now. The only remaining problem is that there
is no way in 8.1 to force postgres to close the current
wal segment, and start using a new one.

Therefor, if there is little traffic, changes can take
a long time to actually replicate, increasing the time-window
of chances which might be lost in case of a crash.

I believe that people are solving this by periodically
copying the currently used wal to the backup server.

I'd like to implement that scheme, but am unsure how
to determine that segment reliably. I noticed that
there is an pg_xlog/archive_status directory, which
contains *.done files for some of the archived wal logs.

Can I safely assume that the wal with the smallest
serial number for which there is no corresponding
file in archive_status is the current used wal?

At the moment pg_xlog/archive_status contains:
00000001000000020000007E.00F95E0C.backup.done
000000010000000200000087.done
000000010000000200000088.don

while pg_xlog contains:
00000001000000020000007E.00F95E0C.backup
000000010000000200000087
000000010000000200000088
000000010000000200000089
00000001000000020000008A
00000001000000020000008B
00000001000000020000008C
00000001000000020000008D
00000001000000020000008E

My guess is that 000000010000000200000089 is currently used, and
that 00000001000000020000008A - 00000001000000020000008E where
created for future use (Why I wouldn't know). Is that assumption correct?

greetings, Florian Pflug

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jochem van Dieten 2006-07-06 16:42:05 Re: [GENERAL] UUID's as primary keys
Previous Message Martijn van Oosterhout 2006-07-06 16:38:06 Re: [GENERAL] UUID's as primary keys