neo4j/neo4j — pull request #2969 by tinwelint (2014-09-01 14:48:34+00:00)
Title: Delays node/rel record changes until commit time

This completes the move from changing record state at the point of making
that change in the transaction to the point where the transaction is
committed. A side effect of that is that KernelStatement no longer needs
access to TransactionRecordState and so the abstractions gets clearer.

The issue provoking this change was that a transaction could create a
relationship and delete it in the same transaction, with the outcome that
a command was created saying to delete that relationship, even though it
didn't exist before the transaction started. Then if replaying a log
containing such a transaction there would be and exception thrown applying
that transsction where the id of that record couldn't be freed since it
was above highId.

This commit also removes duplicate and unexpected checks for if records
exists at the point of converting transaction state into record state. All
those checks now exist in the KernelAPI, and so they were removed from
TransactionRecordState.