> >> xlog.c's ReadRecord formerly contained code that would zero 
> >> out the rest of the log segment (and delete the next log segment,
> >> if any) upon detecting a missing or corrupted xlog record.
> >> I removed that code because I considered it horribly dangerous
> >> where it was. If there is anything wrong with either the xlog or
> >> pg_control's pointers to it, that code was quite capable of wiping
> >> out all hope of recovery *and* all evidence of what went wrong.
> >   ^^^^^^^^^^^^^^^^^^^^^^^^
> 
> What I was thinking about in that last paragraph was manual 
> analysis and recovery. I don't think it's a good idea for automatic
> system startup to skip over gaps in the log.

But if we'll not try to read after gap then after restart system will
not notice gap and valid records after it and just rewrite log space
with new records. Not much chance for manual analysis - ppl will
not report any problems.

Vadim

Tue, 13 Mar 2001 10:15:02 -0800
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
RE: xlog loose ends, continued 
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
>> What I was thinking about in that last paragraph was manual 
>> analysis and recovery. I don't think it's a good idea for automatic
>> system startup to skip over gaps in the log.

> But if we'll not try to read after gap then after restart system will
> not notice gap and valid records after it and just rewrite log space
> with new records. Not much chance for manual analysis - ppl will
> not report any problems.

That'll be true in any case, unless we refuse to start up at all upon
detecting xlog corruption (which doesn't seem like the way to fly).
Not sure what we can do about that.

			regards, tom lane

Tue, 13 Mar 2001 13:20:14 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: xlog loose ends, continued 
Maybe there should be an error message like :

"PostgreSQL has detected severe xlog corruption.  Please fix this with
pg_recover (or similar) manually before restarting the database"?

Guess I'm suggesting a separate xlog recovery tool for "bad cases" of
xlog corruption, so decisions can by manually made by a DBA where
necessary.  Not everything has to be automatic I'm thinking.  There are
probably times where the dBA would prefer behaviour that doesn't seem
intuitive anyway.

Regards and best wishes,

Justin Clift

Tom Lane wrote:
> 
> "Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
> >> What I was thinking about in that last paragraph was manual
> >> analysis and recovery. I don't think it's a good idea for automatic
> >> system startup to skip over gaps in the log.
> 
> > But if we'll not try to read after gap then after restart system will
> > not notice gap and valid records after it and just rewrite log space
> > with new records. Not much chance for manual analysis - ppl will
> > not report any problems.
> 
> That'll be true in any case, unless we refuse to start up at all upon
> detecting xlog corruption (which doesn't seem like the way to fly).
> Not sure what we can do about that.
> 
>                         regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl

Wed, 14 Mar 2001 12:10:52 +1100
Justin Clift <aa2@bigpond.net.au>
Re: Re: xlog loose ends, continued