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 pruner finalize #1860

Merged
merged 5 commits into from
Nov 7, 2023
Merged

fix pruner finalize #1860

merged 5 commits into from
Nov 7, 2023

Conversation

turuslan
Copy link
Contributor

Referenced issues

Description of the Change

  • fix not finalizing after warp sync if --state-pruning

Benefits

Possible Drawbacks

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from Harrm October 31, 2023 13:57
@kamilsa kamilsa self-requested a review November 1, 2023 12:21
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from Harrm November 7, 2023 03:56
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from Harrm November 7, 2023 09:23
Copy link
Contributor

@Harrm Harrm left a comment

Choose a reason for hiding this comment

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

I don't really like this approach with a mutex lock in the beginning of each public method, contrary to more fine-grained mutexes, but I don't know how to do it better here without complex refactoring, so let it be for now.

@@ -91,6 +86,7 @@ namespace kagome::storage::trie_pruner {
const primitives::BlockHeader &state) override;

std::optional<primitives::BlockInfo> getLastPrunedBlock() const override {
std::unique_lock lock{mutex_};
Copy link
Contributor

Choose a reason for hiding this comment

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

shared_lock?

@turuslan turuslan merged commit 0004d37 into master Nov 7, 2023
@turuslan turuslan deleted the fix/pruner-finalize branch November 7, 2023 11:37
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.

3 participants