neo4j/neo4j — pull request #913 by tinwelint (2013-06-28 13:15:31+00:00)
Title: Fixes #911

Problem manifested like this:
After an unclean shutdown and recovery some index queries seemed to
return nodes duplicated in the same result.

Problem distilled to be:
When applying a transaction property updates (to be fed to indexes) are
derived by looking at the before/after views of the changed records.
Except for one case: where a label gets added to a node, in which case
updates for all its existing properties needs to also be generated. This
special case weren't previously isolated to labels added/removed to/from
existing nodes, but were always considered, even for (in that tx) created nodes.
This resulted in a normal commit working since properties aren't loaded
if the node already exists. But recovery would see those properties and
hence generate duplicate updates.

Solution:
Only generate label-changes-updates for (not previously existing) modified nodes.