Re: WAL logging problem in 9.4.3? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WAL logging problem in 9.4.3?
Date
Msg-id 10146.1435942436@sss.pgh.pa.us
Whole thread Raw
In response to Re: WAL logging problem in 9.4.3?  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: WAL logging problem in 9.4.3?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Fujii Masao <masao.fujii@gmail.com> writes:
> Okay, so probably we need to change WAL replay of TRUNCATE so that
> the index file is truncated to one containing only meta page instead of
> empty one. That is, the WAL replay of TRUNCATE would need to call
> index_build() after smgrtruncate() maybe.

That seems completely unworkable.  For one thing, index_build would expect
to be able to do catalog lookups, but we can't assume that the catalogs
are in a good state yet.

I think the responsibility has to be on the WAL-writing end to emit WAL
instructions that lead to a correct on-disk state.  Putting complex
behavior into the reading side is fundamentally misguided.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: WAL logging problem in 9.4.3?
Next
From: Alvaro Herrera
Date:
Subject: Re: Reducing the size of BufferTag & remodeling forks