Re: AIO v2.5 - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: AIO v2.5
Date
Msg-id CAAKRu_Y-W8W0GTfa-QCYxu_EXhdSXKhNz41WgNe-8z3UnWAHQw@mail.gmail.com
Whole thread Raw
In response to Re: AIO v2.5  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Tue, Mar 25, 2025 at 11:58 AM Andres Freund <andres@anarazel.de> wrote:
>
> > Another thought on complete_shared running on other backends: I wonder if we
> > should push an ErrorContextCallback that adds "CONTEXT: completing I/O of
> > other process" or similar, so people wonder less about how "SELECT FROM a" led
> > to a log message about IO on table "b".
>
> I've been wondering about that as well, and yes, we probably should.
>
> I'd add the pid of the backend that started the IO to the message - although
> need to check whether we're trying to keep PIDs of other processes from
> unprivileged users.
>
> I think we probably should add a similar, but not equivalent, context in io
> workers. Maybe "I/O worker executing I/O on behalf of process %d".

I think this has not yet been done. Attached patch is an attempt to
add error context for IO completions by another backend when using
io_uring and IO processing in general by an IO worker. It seems to
work -- that is, running the test_aio tests, you can see the context
in the logs.

I'm not certain that I did this in the way you both were envisioning, though.

- Melanie

Attachment

pgsql-hackers by date:

Previous
From: "Gurjeet Singh"
Date:
Subject: Re: Typo in comment for pgstat_database_flush_cb()
Next
From: Pavel Stehule
Date:
Subject: Re: SQLFunctionCache and generic plans