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>
Cc: Andres Freund <andres@anarazel.de>, Alvaro Herrera
<alvherre@alvh.no-ip.org>, 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-16T17:31:18Z
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 Fri, 2024-02-16 at 13:08 +0530, Bharath Rupireddy wrote: > I'd suggest we strike a balance here - error out in assert builds if > startptr+count is past the current insert position and trust the > callers for production builds. It's not reasonable to have divergent behavior between assert-enabled builds and production. I think for now I will just commit the Assert as Andres suggested until we work out a few more details. One idea is to use Álvaro's work to eliminate the spinlock, and then add a variable to represent the last known point returned by WaitXLogInsertionsToFinish(). Then we can cheaply Assert that the caller requested something before that point. > Here, I'm with v23 patch set: Thank you, I'll look at these. Regards, Jeff Davis