On Mon, Jan 4, 2016 at 2:28 PM, Andres Freund <andres@anarazel.de> wrote:
>> I think at the very least the cache should be protected by a separate >> lock, and that lock should be acquired with TryLock. I.e. the cache is >> updated opportunistically. I'd go for an lwlock in the first iteration.
>I also think this observation of yours is right and currently that is
>okay because we always first check TransactionIdIsCurrentTransactionId().
>+ const uint32 snapshot_cached= 0;
I have fixed all of the issues reported by regress test. Also now when backend try to cache the snapshot we also try to store the self-xid and sub xid, so other backends can use them.