Skip site navigation (1) Skip section navigation (2)

Re: PITR logging control program

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PITR logging control program
Date: 2004-04-29 14:22:40
Message-ID: 200404291422.i3TEMe026555@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera wrote:
> On Thu, Apr 29, 2004 at 10:07:01AM -0400, Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> 
> > > Is the API able to indicate a written but not-yet-filled WAL segment?
> > > So an archiver could copy the filled part, and refill it later.  This
> > > may be needed because a segment could take a while to be filled.
> > 
> > I couldn't figure that out, but I don't think it does.  It would have to
> > lock the WAL writes so it could get a good copy, I think, and I didn't
> > see that.
> 
> I'm not sure but I don't think so.  You don't have to lock the WAL for
> writing, because it will always write later in the file than you are
> allowed to read.  (If you read more than you were told to, it's your
> fault as an archiver.)

My point was that without locking the WAL, we might get part of a WAL
write in our file, but I now realize that during a crash the same thing
might happen, so it would be OK to just copy it even if it is being
written to.

Simon posted the rest of his patch that shows changes to the backend,
and a comment reads:

+  * The name of the notification file is the message that will be picked up
+  * by the archiver, e.g. we write RLogDir/00000001000000C6.full
+  * and the archiver then knows to archive XLOgDir/00000001000000C6,
+  * while it is doing so it will rename RLogDir/00000001000000C6.full
+  * to RLogDir/00000001000000C6.busy, then when complete, rename it again
+  * to RLogDir/00000001000000C6.done

so it is only archiving full logs.

Also, I think this archiver should be able to log to a local drive,
network drive (trivial), tape drive, ftp, or use an external script to
transfer the logs somewhere.  (ftp would probably be an external script
with 'expect').

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2004-04-29 14:23:08
Subject: Re: 7.5 features
Previous:From: Alvaro HerreraDate: 2004-04-29 14:11:13
Subject: Re: PITR logging control program

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group