Re: will PITR in 8.0 be usable for "hot spare"/"log shipping" type of replication

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eric Kerin <eric(at)bootseg(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: will PITR in 8.0 be usable for "hot spare"/"log shipping" type of replication
Date: 2004-08-14 05:11:38
Message-ID: 1805.1092460298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Eric Kerin <eric(at)bootseg(dot)com> writes:
> The issues I've seen are:
> 1. Knowing when the master has finished the file transfer transfer to
> the backup.

The "standard" solution to this is you write to a temporary file name
(generated off your process PID, or some other convenient reasonably-
unique random name) and rename() into place only after you've finished
the transfer. If you are paranoid you can try to fsync the file before
renaming, too. File rename is a reasonably atomic process on all modern
OSes.

> 2. Handling the meta-files, (.history, .backup) (eg: not sleeping if
> they don't exist)

Yeah, this is an area that needs more thought. At the moment I believe
both of these will only be asked for during the initial microseconds of
slave-postmaster start. If they are not there I don't think you need to
wait for them. It's only plain ol' WAL segments that you want to wait
for. (Anyone see a hole in that analysis?)

> 3. Keeping the backup from coming online before the replay has fully
> finished in the event of a failure to copy a file, or other strange
> errors (out of memory, etc).

Right, also an area that needs thought. Some other people opined that
they want the switchover to occur only on manual command. I'd go with
that too if you have anything close to 24x7 availability of admins.
If you *must* have automatic switchover, what's the safest criterion?
Dunno, but let's think ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-14 05:53:47 Re: Pseudo-Off-topic-survey: Opinions about future of Postgresql(MySQL)?
Previous Message Eric Kerin 2004-08-14 04:51:15 Re: will PITR in 8.0 be usable for "hot spare"/"log