I think the previous patch to snapmgr.c was mistaken. Instead of fixing
a single trouble spot, we're better off fixing PushActiveSnapshot so
that any use of it that involves a snapshot that's subject to a future
command counter update should create a new copy.
This is correct because the 8.3 code used to do CopySnapshot anytime it
was setting ActiveSnapshot. So we're not disrupting any behavior here
-- we're merely restoring what was the previous customary behavior.
The attached patch implements this idea. It reverts the code changes
done in the previous patch, because they're obviously no longer
necessary. The new regression test that it added still passes with this
new patch. I will add a new one for this new problem.
(This new patch restores CopySnapshot as a static function too).
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.