Re: Analysis of ganged WAL writes - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: Analysis of ganged WAL writes
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961EB7@m0114.s-mxs.net
Whole thread Raw
In response to Analysis of ganged WAL writes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > Can the magic be, that kaio directly writes from user space memory to the
> > disk ?
>
> This makes more assumptions about the disk drive's behavior than I think
> are justified...

No, no assumption about the drive, only the kaio implementation, namely, that
the kaio implementation reads the user memory at a latest (for the implementation)
possible time.

> > Since in your case all transactions A-E want the same buffer written,
> > the memory (not it's content) will also be the same.
>
> But no, it won't: the successive writes will ask to write different
> snapshots of the same buffer.

That is what I meant, yes. Should have better formulated memory location.

> > The problem I can see offhand is how the kaio system can tell which
> > transaction can be safely notified of the write,
>
> Yup, exactly.  Whose snapshot made it down to (stable) disk storage?

That is something the kaio implementation could prbbly know in our scenario,
where we iirc only append new records inside the page (don't modify anything
up front). Worst thing that can happen is that the kaio is too pessimistic
about what is already on disk (memory already written, but aio call not yet done).

Andreas


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Where to call SetQuerySnapshot
Next
From: Bruce Momjian
Date:
Subject: Statistical Analysis, Vacuum, and Selectivity Restriction (PostGIS) (fwd)