| From: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
|---|---|
| To: | Xuneng Zhou <xunengzhou(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: remove unused shared WAL flush request |
| Date: | 2026-11-25 08:08:36 |
| Message-ID: | awaWGjB5S-czddNq@alvherre.pgsql |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
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)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-11-25 08:09:01 | Re: [PATCH] psql: Complete GRANTED BY in GRANT and REVOKE |
| Previous Message | Alexandre Felipe | 2026-11-25 07:54:56 | Re: SLOPE - Planner optimizations on monotonic expressions. |