On 2015-12-19 22:47:30 -0800, Mithun Cy wrote: > After some analysis I saw writing to shared memory to store shared snapshot > is not protected under exclusive write lock, this leads to memory > corruptions. > I think until this is fixed measuring the performance will not be much > useful.
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. If that works nicely we can try to keep several 'snapshot slots' around, and only lock one of them exclusively. With some care users of cached snapshots can copy the snapshot, while another slot is updated in parallel. But that's definitely not step 1. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers