On 2026-Nov-25, Xuneng Zhou wrote: > Hi, > > It seems that XLogCtl->LogwrtRqst.Flush has long been unused; can we reduce > the shared request to a single write position? > > Backends publish a shared write target so the WAL writer can know WAL to > write. For flushing, a backend calling XlogFlush() already knows the LSN it > needs made durable by checking shared flush progress and it performas the > flush itself if necessary. The WAL writer selects its work using the shared > write request and asyncXactLSN, then choose the flush target based on its > flush policy. > > The shared Flush field doesn't participate in those decisions. Startup > initializes it, and XLogWrite() advances it to match finished flush > progress. XLogBackgroundFlush() copies it but overwrites the local value > before using it.
Interesting. I can't confirm these findings, but if we're modifying this code, please let's use less of a consonant soup for a name; how about LogWriteRequest or WALWriteRequest or walWriteRequest? Also, do we still need struct XLogwrtRqst? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "I can't go to a restaurant and order food because I keep looking at the fonts on the menu. Five minutes later I realize that it's also talking about food" (Donald Knuth)
