Simplifying "standby mode" - Mailing list pgsql-hackers

From Tom Lane
Subject Simplifying "standby mode"
Date
Msg-id 20900.1154958494@sss.pgh.pa.us
Whole thread Raw
Responses Re: Simplifying "standby mode"
List pgsql-hackers
I'm in process of reviewing the restartable-recovery patch,
http://archives.postgresql.org/pgsql-patches/2006-07/msg00356.php
and I'm wondering if we really need to invent a "standby mode" boolean
to get the right behavior.  The problem I see with that flag is that
it'd be static over a run, whereas the behavior we want is dynamic.
It seems entirely likely that a slave will be started from a base backup
that isn't quite current, and will need to run through some archived WAL
segments quickly before it catches up to the master.  So during the
catchup period we'd prefer that it not do restartpoints one-for-one
with the logged checkpoints, whereas after it's caught up, that's what
we want.

I'm thinking that we could instead track the actual elapsed time since
the last restartpoint, and do a restartpoint when we encounter a
checkpoint WAL record and the time since the last restartpoint is
at least X.  I'd be inclined to just use checkpoint_timeout for X,
although perhaps there's an argument to be made for making it
separately settable.

Thoughts?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: proposal for 8.3: Simultaneous assignment for PL/pgSQL
Next
From: Martijn van Oosterhout
Date:
Subject: Re: pg_upgrade (was: 8.2 features status)