neo4j/neo4j — pull request #3290 by digitalstain (2014-10-15 11:24:28+00:00)
Title: [2.2] Ensures that Relationship commands in upgraded logs have proper first in chain flags

... chain flags

Previously upgraded logs would simply copy over relationships commands, leaving
default values for the firstInFirstChain and firstInSecondChain fields. This
could result in pointer chasing errors if these transactions were applied to an
otherwise properly upgraded store, a scenario that comes up in backup. In
particular, backup will copy the store and then the upgraded transactions,
which would update the relevant relationship records to have
wrong values for those flags, affecting pointer following.
This commit checks if the currently transferred LogEntry holds
a RelationshipCommand and if so it sets up the first in chain flags
properly.
This approach, while improving on the problem, does not completely solve it.
While the pointers will be interpreted correctly, the first record in a
relationship chain will still have its previous pointer set to -1, which
will overwrite the current value that represents the relationship count
for this chain. This issue affects backups that are created
immediately after an upgrade from 1.9 or 2.0.