Re: AIO v2.2

2025-02-21 Thread Andres Freund
Hi, I was just going through comments about LWLockDisown() and was reminded of this: On 2025-01-07 18:08:51 +0200, Heikki Linnakangas wrote: > On LWLockDisown(): > > + * NB: This will leave lock->owner pointing to the current backend (if > > + * LOCK_DEBUG is set). We could add a separate flag in

Re: AIO v2.2

2025-01-14 Thread Robert Haas
On Mon, Jan 13, 2025 at 4:46 PM Andres Freund wrote: > Once the IO is really done, the handle is immediately recycled (and moved into > IDLE state, ready to be used again). OK, fair enough. -- Robert Haas EDB: http://www.enterprisedb.com

Re: AIO v2.2

2025-01-13 Thread Andres Freund
Hi, On 2025-01-13 15:43:46 -0500, Robert Haas wrote: > On Wed, Jan 8, 2025 at 7:26 PM Andres Freund wrote: > > 1) Shared memory representation of an IO, for the AIO subsystem internally > > > >Currently: PgAioHandle > > > > 2) A way for the issuer of an IO to reference 1), to attach informati

Re: AIO v2.2

2025-01-13 Thread Robert Haas
On Wed, Jan 8, 2025 at 7:26 PM Andres Freund wrote: > 1) Shared memory representation of an IO, for the AIO subsystem internally > >Currently: PgAioHandle > > 2) A way for the issuer of an IO to reference 1), to attach information to the >IO > >Currently: PgAioHandle* > > 3) A way for

Re: AIO v2.2

2025-01-08 Thread Andres Freund
Hi, On 2025-01-07 14:59:58 -0500, Robert Haas wrote: > On Tue, Jan 7, 2025 at 11:11 AM Andres Freund wrote: > > The difference between a handle and a reference is useful right now, to have > > some separation between the functions that can be called by anyone (taking a > > PgAioHandleRef) and onl

Re: AIO v2.2

2025-01-08 Thread Andres Freund
Hi, On 2025-01-07 22:09:56 +0200, Heikki Linnakangas wrote: > On 07/01/2025 18:11, Andres Freund wrote: > > > I didn't quite understand the point of the prepare callbacks. For example, > > > when AsyncReadBuffers() calls smgrstartreadv(), the > > > shared_buffer_readv_prepare() callback will be ca

Re: AIO v2.2

2025-01-07 Thread Heikki Linnakangas
On 07/01/2025 18:11, Andres Freund wrote: The difference between a handle and a reference is useful right now, to have some separation between the functions that can be called by anyone (taking a PgAioHandleRef) and only by the issuer (PgAioHandle). That might better be solved by having a PgAioHa

Re: AIO v2.2

2025-01-07 Thread Robert Haas
On Tue, Jan 7, 2025 at 11:11 AM Andres Freund wrote: > The difference between a handle and a reference is useful right now, to have > some separation between the functions that can be called by anyone (taking a > PgAioHandleRef) and only by the issuer (PgAioHandle). That might better be > solved b

Re: AIO v2.2

2025-01-07 Thread Noah Misch
On Mon, Jan 06, 2025 at 04:40:26PM -0500, Andres Freund wrote: > On 2025-01-06 10:52:20 -0800, Noah Misch wrote: > > On Tue, Dec 31, 2024 at 11:03:33PM -0500, Andres Freund wrote: > - We have pretty no testing for IO errors. Yes, that's remained a gap. I've wondered how much to address this via

Re: AIO v2.2

2025-01-07 Thread Andres Freund
Hi, On 2025-01-07 18:08:51 +0200, Heikki Linnakangas wrote: > On LWLockDisown(): > > > +/* > > + * Stop treating lock as held by current backend. > > + * > > + * After calling this function it's the callers responsibility to ensure > > that > > + * the lock gets released, even in case of an erro

Re: AIO v2.2

2025-01-07 Thread Andres Freund
Hi, On 2025-01-07 17:09:58 +0200, Heikki Linnakangas wrote: > On 01/01/2025 06:03, Andres Freund wrote: > > Hi, > > > > Attached is a new version of the AIO patchset. > > I haven't gone through it all yet, but some comments below. Thanks! > > The biggest changes are: > > > > - The README has

Re: AIO v2.2

2025-01-07 Thread Heikki Linnakangas
On LWLockDisown(): +/* + * Stop treating lock as held by current backend. + * + * After calling this function it's the callers responsibility to ensure that + * the lock gets released, even in case of an error. This only is desirable if + * the lock is going to be released in a different process

Re: AIO v2.2

2025-01-07 Thread Heikki Linnakangas
On 01/01/2025 06:03, Andres Freund wrote: Hi, Attached is a new version of the AIO patchset. I haven't gone through it all yet, but some comments below. The biggest changes are: - The README has been extended with an overview of the API. I think it gives a good overview of how the API fi

Re: AIO v2.2

2025-01-06 Thread Andres Freund
Hi, On 2025-01-06 10:52:20 -0800, Noah Misch wrote: > Patches 1 and 2 are still Ready for Committer. I feel somewhat weird about pushing 0002 without a user, but I guess it's still exercised, so it's probably fine... > On Tue, Dec 31, 2024 at 11:03:33PM -0500, Andres Freund wrote: > > - The REA

Re: AIO v2.2

2025-01-06 Thread Noah Misch
Patches 1 and 2 are still Ready for Committer. On Tue, Dec 31, 2024 at 11:03:33PM -0500, Andres Freund wrote: > - The README has been extended with an overview of the API. I think it gives a > good overview of how the API fits together. I'd be very good to get > feedback from folks that aren'