Re: Improve WALRead() to suck data directly from WAL buffers when possible
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andres Freund <andres@anarazel.de>, Dilip Kumar <dilipbalaut@gmail.com>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
pgsql-hackers@lists.postgresql.org, Nathan Bossart
<nathandbossart@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2024-02-12T23:56:19Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add XLogCtl->logInsertResult
- f3ff7bf83bce 17.0 cited
-
Add assert to WALReadFromBuffers().
- 9ecbf54075a9 17.0 landed
-
Read WAL directly from WAL buffers.
- 91f2cae7a4e6 17.0 landed
-
Additional write barrier in AdvanceXLInsertBuffer().
- 766571be1659 17.0 landed
-
Use 64-bit atomics for xlblocks array elements.
- c3a8e2a7cb16 17.0 landed
-
Don't trust unvalidated xl_tot_len.
- bae868caf222 17.0 cited
On Mon, 2024-02-12 at 11:33 -0800, Jeff Davis wrote: > For 0002 & 0003, I'd like more clarity on how they will actually be > used by an extension. In patch 0002, I'm concerned about calling WaitXLogInsertionsToFinish(). It loops through all the locks, but doesn't have any early return path or advance any state. So if it's repeatedly called with the same or similar values it seems like it would be doing a lot of extra work. I'm not sure of the best fix. We could add something to LogwrtResult to track a new LSN that represents the highest known point where all inserters are finished (in other words, the latest return value of WaitXLogInsertionsToFinish()). That seems invasive, though. Regards, Jeff Davis