Re: Add wait events for server logging destination writes

From: Nikolay Samokhvalov <nik(at)postgres(dot)ai>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: assam258(at)gmail(dot)com, 신성준 <shinsj4653(at)gmail(dot)com>, x4mmm(at)yandex-team(dot)ru, wolakk(at)gmail(dot)com, andreas(at)proxel(dot)se, jakub(dot)wartak(at)enterprisedb(dot)com, horikyota(dot)ntt(at)gmail(dot)com, jian(dot)universality(at)gmail(dot)com
Subject: Re: Add wait events for server logging destination writes
Date: 2026-11-04 06:43:58
Message-ID: CAM527d98WMWN1w2gkqbKf_uy6vXDny7yU_sSe8wKx5H7yAu3Lg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Seongjun,

On Wed, Oct 28, 2026 at 10:00 PM 신성준 <shinsj4653(at)gmail(dot)com> wrote:
> v9 keeps an outer wait event across a log write by using
> pgstat_report_wait_start_nested() / pgstat_report_wait_end_nested()
> at the new logging sites. That was the open point from Nik's last
> review.
>
> What would help most now:
> - Nik, a rerun of your harness against v9 when you have a free
> moment. No hurry.

My AI harness tested v9 on master at b6178c942ea7, cassert build. The
outer event survives the log write now. Sampled after ereport(LOG)
returned, inside the extension's region, v9 shows

active | Extension | HarnessOuterWait

for stderr with logging_collector off and on, csvlog, jsonlog, all
three together, and syslog. v8 shows an empty wait_event_type and
wait_event in the same runs, so the check can tell them apart. The
core regression suite passes with v9.

I also read the wrapped sites. They wrap only leaf OS calls (write(),
openlog(), syslog(), and the Windows calls in 0002), and nothing in
between can ereport, so I see no path that leaves start without end.

No new findings. I did not test Windows or the macro alternative
Henson described.

From the tester's side I consider v9 ready.

Thanks,
Nik

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-11-04 06:54:43 Re: Fix DEFAULT marker handling in COPY FROM ... HEADER MATCH
Previous Message Nikolay Samokhvalov 2026-11-04 06:41:15 Re: pgsql: Reduce "Var IS [NOT] NULL" quals during constant folding