On 2018-11-11 11:29:54 +1300, Thomas Munro wrote: > On Sat, Nov 10, 2018 at 6:01 PM Andres Freund <and...@anarazel.de> wrote: > > I've replaced that with a write barrier / read barrier. I strongly > > suspect this isn't a problem on the write side in practice (due to the > > dependent read), but the read side looks much less clear to me. I think > > explicitly using barriers is much saner these days. > > > > Comments? > > +1 > > I said the same over here: > > https://www.postgresql.org/message-id/flat/CAEepm%3D1nff0x%3D7i3YQO16jLA2qw-F9O39YmUew4oq-xcBQBs0g%40mail.gmail.com
Hah! Sorry for missing that back then. I think your patch from back then misses a few things that mine did. But I also think mine missed the fact that XidCacheRemove is problematic - I only was thinking of the *reads* of MyPgXact->nxids in XidCacheRemoveRunningXids(), but you correctly observe that the write is the problematic case (the reads are ok, because it's the same process as GetNewTransactionId()). Greetings, Andres Freund