Alvaro Herrera wrote:
> 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.
For a while I was thinking this was useless, because surely
CurrentSnapshot would always be pointing to static storage, no?
However I realized that this is not the case in serializable
transactions, because such transaction need to register the current
snapshot and thus it creates a copy of it. So the problem is that in a
serializable snapshot, ActiveSnapshot may be pointing to the exact same
copy that a CommandCounterIncrement would modify.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support