Skip to content

Add a test for simultaneous reads/writes #5

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lachenmayer
Copy link
Contributor

This test works fine in random-access-file, but breaks in my project https://github.com/lachenmayer/random-access-key-value because I check the database to read the "current" value, and sometimes the previous write has not yet completed.

I noticed this when trying to use random-access-key-value with a hypertrie as storage backend (as in this gist). The root cause is that hypercore writes to some tree location 3, and then writes the new root to tree location 2 instantly, apparently without waiting for completion from the first write.

@lachenmayer lachenmayer mentioned this pull request Jul 17, 2018
@lachenmayer lachenmayer force-pushed the simultaneous-writes branch from 7d76b54 to caf8dc8 Compare July 21, 2018 10:14
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.

1 participant