Fixed command aggregation for legacy indexes #6022
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
LegacyIndexTransactionStateImpl
is responsible for tracking node/relationship additions and removals. It uses two separate maps for this. Each map has index name as a key and list of corresponding commands as a value. When index is dropped, corresponding list of commands is cleared.However additions to relationship legacy index ended up in the map dedicated to node legacy index and removals from relationship legacy index cleared commands from the node map. In particular this was a problem for node and relationship indexes that had same name. It could lead to missing entries in the legacy index after transaction completed successfully.
This commit makes
LegacyIndexTransactionStateImpl
use relationship map for relationship commands. It also improvesequals
/hashCode
methods for legacy index commands.