Hi Tom,

> Do we really need a serializable snapshot for reading the notify
> queue? If we do, can we acquire it before making any important state
> changes?

I did some investigation today and I don't think we need a serializable
snapshot.

If I understand correctly, the read only uses the snapshot to ask
XidInMVCCSnapshot() whether the sender is still running. But
GetLatestSnapshot() sets up the transaction snapshot when there is none
yet.
In a serializable read only deferrable transaction that waits for a safe
snapshot.

So we just need to call GetSnapshotData(), but that needs a snapshot.
I created a static one in async.c because feels like we should not
touch snapmgr for encapsulation. If you'd rather keep this in
snapmgr.c, a small wrapper there would work too.



Thanks,
Shihao

Attachment: v2-0001-Don-t-wait-for-a-safe-snapshot-when-reading-the-n.patch
Description: Binary data

Reply via email to