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

enforce the correct order of writes to storage #1441

Merged
merged 2 commits into from
Jan 6, 2020

Conversation

eugene-babichenko
Copy link
Contributor

@eugene-babichenko eugene-babichenko commented Dec 24, 2019

Removing the global lock from the storage allowed for better
performance. However, there is an issue of writes possibly done
out of the expected order due to the underlying pool of parallel sqlite
connections or put_block/tag tasks being run in parallel tokio
executors. Now we introduce the global write lock for the block storage
while still allowing parallel reads.

Should fix #1422 (p. 3) #1438

Removing the global lock from the storage allowed for better
performance. However, there is an issue of writes possibly done
out of the expected order due to the underlying pool of parallel sqlite
connections or put_block/tag tasks being run in parallel tokio
executors. Now we introduce the global write lock for the block storage
while still allowing parallel reads.
@eugene-babichenko eugene-babichenko added bug Something isn't working subsys-storage all that relate to storage issues labels Dec 24, 2019
Copy link
Contributor

@NicolasDP NicolasDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. a little comment in the Storage structure would be welcome.
Especially it would be useful to explain why there is a Lock of the same object and how it is meant to be used.

jormungandr/src/blockchain/storage.rs Outdated Show resolved Hide resolved
@eugene-babichenko
Copy link
Contributor Author

@NicolasDP Added a comment and renamed the fields of Storage so that they make more sense.

Copy link
Contributor

@NicolasDP NicolasDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NicolasDP
Copy link
Contributor

@mzabaluev , This might be linked to some of the state management issue we saw the last past week in the candidate tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working subsys-storage all that relate to storage issues
Projects
Development

Successfully merging this pull request may close these issues.

0.8.5-alpha1 panics observed
3 participants