| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | 신성준 <shinsj4653(at)gmail(dot)com> |
| Cc: | Nikolay Samokhvalov <nik(at)postgres(dot)ai>, assam258(at)gmail(dot)com, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 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-10 07:43:15 |
| Message-ID: | avLLE_a_fbw47lGr@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Sun, Nov 08, 2026 at 01:27:49PM +0900, 신성준 wrote:
> v9 still applies cleanly to current master, so no new version.
+ outer_wait_event_info =
+ pgstat_report_wait_start_nested(WAIT_EVENT_SYSLOG_WRITE);
The concept of nesting is a lie. The wait events you are setting are
not saved in a stack; they're just replaced and saved in place. I am
wondering if something like a pgstat_report_wait_swap() would be more
adapted? If you have a better idea of name, feel free.
Then you would get:
old_event = pgstat_report_wait_swap(new_event);
//do stuff
pgstat_report_wait_swap(old_event);
That would avoid any cloberring of the wait events that an upper layer
calling the elog functions could have set. One API, two calls each
time.
+ * A log message can be written while another wait event is already
+ * published, for instance by an extension that logs from inside its own
+ * wait region, or by quickdie() running in a signal handler. Wait events
+ * are single-slot and pgstat_report_wait_end() clears the field, which
+ * would leave the enclosing region without its event for as long as it
+ * lasts. The nested variants used here and at the other logging writes
+ * put the outer event back once the write is done.
This is AI slop to me. None of this level of details is required.
Even if required, I'd limit that to a few words at most just to say
that we don't want to clobber any information set, if set. But the
intention would be clearly documented if one uses this "swap" API
anyway (or whatever the way you would like to call it) because the old
value is pushed back to my_wait_event_info.
And note that I highly doubt that these commit messages need contents
worth more than 3 screens. So could I suggest that you keep your
agent at bay in terms of quality, please? This does not really help.
Also, perhaps split your new API into a first patch, then write a
second patch that makes use of it. Doing both at the same time feels
confusing.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Xnerv Wang | 2026-11-10 08:11:52 | [PATCH] pg_input_is_valid() reuses the first type name inside a PL/pgSQL loop |
| Previous Message | Henson Choi | 2026-11-10 07:36:11 | Re: configure picks a clang that doesn't match LLVM_CONFIG |