Re: [GENERAL] Slow PITR restore - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [GENERAL] Slow PITR restore
Date
Msg-id 1197541308.4255.1709.camel@ebony.site
Whole thread Raw
In response to Re: [GENERAL] Slow PITR restore  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: [GENERAL] Slow PITR restore  (Gregory Stark <stark@enterprisedb.com>)
Re: [GENERAL] Slow PITR restore  ("Guillaume Smet" <guillaume.smet@gmail.com>)
Re: [GENERAL] Slow PITR restore  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Thu, 2007-12-13 at 09:45 +0000, Gregory Stark wrote:
> "Simon Riggs" <simon@2ndquadrant.com> writes:
> 
> > On Thu, 2007-12-13 at 06:27 +0000, Gregory Stark wrote:
> >> Heikki proposed a while back to use posix_fadvise() when processing logs to
> >> read-ahead blocks which the recover will need before actually attempting to
> >> recover them. On a raid array that would bring the 3MB/s above up to the
> >> maximum number of random accesses the raid array can handle (ie, definition
> >> (2) above).
> >
> > It's a good idea, but it will require more complex code. I prefer the
> > simpler solution of using more processes to solve the I/O problem.
> 
> Huh, I forgot about that idea. Ironically that was what I suggested when
> Heikki described the problem.
> 
> I think it's more complex than using posix_fadvise. 

Some handwaving...

ISTM its just autovacuum launcher + Hot Standby mixed.

I guess I've added two new backends now (Tom groans...) so that part
seems very straightforward. The harder part is distributing the work and
the hardest part is doing that evenly enough to make a difference. It
will also require rmgr changes for state handling, but then I think that
needs work anyway. Maybe we don't even need a master.

We would have readbuffers in shared memory, like wal_buffers in reverse.
Each worker would read the next WAL record and check there is no
conflict with other concurrent WAL records. If not, it will apply the
record immediately, otherwise wait for the conflicting worker to
complete. 

> But it's also more ambitious. 

Time is the issue, I think, so you may be right. That's always why I
grunt so much about freeze dates.

Anyway, I'll leave this now, since I think we need to do Florian's work
first either way and that is much more eagerly awaited I think.

--  Simon Riggs 2ndQuadrant  http://www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: [GENERAL] Slow PITR restore
Next
From: Simon Riggs
Date:
Subject: [Fwd: [PATCHES] archiver ps display]