Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix index state with UPDATE queries #368

Merged
merged 4 commits into from
Mar 11, 2021
Merged

Fix index state with UPDATE queries #368

merged 4 commits into from
Mar 11, 2021

Conversation

asdine
Copy link
Collaborator

@asdine asdine commented Mar 11, 2021

This fixes how UPDATE queries on indexed tables would cause some indexes to be in an incorrect state.
This was caused by the "trash bin" mechanism implemented in both bolt and memory engines, where nodes would get marked as deleted without modifying the btree and then actually removed when the transaction is committed.
The error occurred when a key was marked for deletion and then overwritten (which happens a lot when we run UPDATE on indexed fields that are not modified), the cleanup mechanism would delete them even when it's not supposed to.
This PR also fixes a race condition occurring in the memory engine.

Fixes #355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update returning "key not found"
1 participant