Re: Track Oldest Initialized WAL Buffer Page - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Track Oldest Initialized WAL Buffer Page
Date
Msg-id 20230301041931.GB1453450@nathanxps13
Whole thread Raw
In response to Re: Track Oldest Initialized WAL Buffer Page  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Track Oldest Initialized WAL Buffer Page
List pgsql-hackers
On Tue, Feb 28, 2023 at 11:12:29AM +0530, Bharath Rupireddy wrote:
> On Tue, Feb 28, 2023 at 5:52 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>> It's confusing to me that OldestInitializedPage is set to NewPageBeginPtr.
>> Doesn't that set it to the beginning of the newest initialized page?
> 
> Yes, that's the intention, see below. OldestInitializedPage points to
> the start address of the oldest initialized page whereas the
> InitializedUpTo points to the end address of the latest initialized
> page. With this, one can easily track all the WAL between
> OldestInitializedPage and InitializedUpTo.

This is where I'm confused.  Why would we set the variable for the start
address of the _oldest_ initialized page to the start address of the
_newest_ initialized page?  I must be missing something obvious, so sorry
if this is a silly question.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Improve WALRead() to suck data directly from WAL buffers when possible
Next
From: Nathan Bossart
Date:
Subject: Re: Weird failure with latches in curculio on v15