Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Date
Msg-id 23805.1522165309@sss.pgh.pa.us
Whole thread Raw
In response to Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Pavan Deolasee <pavan.deolasee@gmail.com> writes:
> On Tue, Mar 27, 2018 at 7:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> If you have to search backwards, this breaks it.  Full stop.

> We don't really need to fetch the previous record. We really need to find
> the last checkpoint prior to a given LSN. That can be done by reading WAL
> segments forward. It can be a little slow, but hopefully not a whole lot.

This is ignoring the possibility of damaged data in between, ie

A ... B ... CHKPT ... C ...  a few zeroed pages ... D ... CHKPT ... E ... F

If A is the start of the WAL segment, and you ask what's the last
checkpoint before F, you will get the wrong answer.  Or, if you're
paranoid and verify that you can follow the chain all the way to F,
you'll fail ... needlessly, and in a case where we previously succeeded.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Next
From: Peter Eisentraut
Date:
Subject: Re: PQHost() undefined behavior if connecting string contains bothhost and hostaddr types