Pushed this to 9.4 - master after some more tinkering.
It occurred to me that it might be better to have
ReorderBufferSetBaseSnapshot do the IncrRefCount instead of expecting
caller to do it. But I wouldn't backpatch that change, so I refrained.
Thanks for the patch.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services