On Fri, May 10, 2013 at 7:44 AM, Simon Riggs <si...@2ndquadrant.com> wrote: >> Having one corrupt record followed by a valid record is not an >> abnormal situation. It could easily be the correct end of WAL. > > I disagree, that *is* an abnormal situation and would not be the > "correct end-of-WAL". > > Each WAL record contains a "prev" pointer to the last WAL record. So > for the next record to be valid the prev pointer would need to be > exactly correct.
Well then you're wrong. The OS makes no guarantee that blocks are written out in order. When the system crashes any random subset of the blocks written but not synced might have been written to disk and others not. There could be megabytes of correct WAL written with just one block in the middle of the first record not written. If no xlog sync had occurred (or one was in progress but not completed) then that's the correct end of WAL. -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers