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

bug: fix concurrent same-row mutations #11

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

jehiah
Copy link
Member

@jehiah jehiah commented Feb 14, 2024

Because the underlying datastore rows_t is single-row per rowKey all row operations involve a datastore get() followed by update/insert; this means there is a race condition with concurrent updates where intermediate updates are lost.

This adds table level locking to serialize operations. The goal for this emulator isn't fast it's correct and persistent.

@jehiah jehiah added the bug Something isn't working label Feb 14, 2024
@jehiah jehiah self-assigned this Feb 14, 2024
@jehiah jehiah requested a review from pevans96 February 14, 2024 03:14
@jehiah jehiah force-pushed the concurrent_mutations_11 branch from 792bfbb to 967f764 Compare February 14, 2024 03:16
bttest/inmem_test.go Outdated Show resolved Hide resolved
@jehiah jehiah force-pushed the concurrent_mutations_11 branch from 967f764 to e1899ee Compare February 14, 2024 03:53
@jehiah jehiah merged commit f5c75b0 into bitly:master Feb 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants