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(state): use rw lock to prevent inconsitent state view #4867

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

Erigara
Copy link
Contributor

@Erigara Erigara commented Jul 19, 2024

Description

While restarting iroha i've noticed that snapshot is inconsistent.
After some investigation i've noticed that assumption i had about the State was wrong (check this issue).
This PR fix this inconsistency by introducing lock which is used to guard block commit and prevent creation of inconsistent views of the State.

Benefits

Views are consistent.

Downsides

Rwlock has problems with writer starvation.

@Erigara Erigara self-assigned this Jul 19, 2024
@Erigara Erigara added the Bug Something isn't working label Jul 19, 2024
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
@mversic mversic enabled auto-merge (squash) July 23, 2024 08:47
@mversic mversic merged commit 6f28b38 into hyperledger:main Jul 23, 2024
11 of 12 checks 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants