Re: Add wait events for server logging destination writes

From: 신성준 <shinsj4653(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Henson Choi <assam258(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Nikolay Samokhvalov <nik(at)postgres(dot)ai>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Kirk Wolak <wolakk(at)gmail(dot)com>, Andreas Karlsson <andreas(at)proxel(dot)se>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: Add wait events for server logging destination writes
Date: 2026-11-19 06:05:32
Message-ID: CACdN0M6b32FYWG0dRKmCqZ2jr=4gWEcDP0Hs4G1pgXCO2JHSbw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Andrey Borodin wrote:
> Could we reuse the debug nesting check to collect inner/outer call
> sites over a check-world run

I changed the check to record the pairs instead of aborting, and ran
meson test with TAP and injection points enabled. On master
(b0496e30830) no wait event was started while another one was set.

With the logging events added, a log write happened inside a wait in
six processes: once in quickdie() during ClientRead, and five times in
injection_wait() when the process was canceled or terminated. In all
six the outer wait ends there, by ERROR or process exit.

Andres Freund wrote:
> If there are places where wait events clear an exising wait event,
> that code needs to be fixed.

Understood. v11 drops the swap and the Windows part. It is a single
patch with plain pgstat_report_wait_start()/end() around the log
writes.

This means an extension that logs inside its own wait and keeps
waiting loses that wait event, which is what Nikolay's harness showed
with v8.
--
Best regards,
Seongjun

Attachment Content-Type Size
v11-0001-Add-wait-events-for-server-logging-destination-w.patch text/x-diff 5.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-11-19 06:10:44 Re: [PATCH] Report changes discarded for relations not in the subscription
Previous Message Nitin Jadhav 2026-11-19 06:00:10 Re: [PATCH] Check interrupts while draining received WAL