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

Remove broken blocks #1068

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Remove broken blocks #1068

merged 1 commit into from
Jul 2, 2020

Conversation

mrsmkl
Copy link
Contributor

@mrsmkl mrsmkl commented Jun 8, 2020

Description

When DB is corrupted, removes all blocks that have no associated states.

Other changes

Added a check to avoid segfault when quitting with interrupt.

Tested

Only manual testing.

Related issues

Backwards compatibility

@nategraf
Copy link
Contributor

nategraf commented Jul 1, 2020

Could you explain a bit more why this change is needed ? Which check "might cause segfault when quitting with interrupt" and why can't that segfault be avoided?

@mrsmkl
Copy link
Contributor Author

mrsmkl commented Jul 1, 2020

I meant that there's an issue that might cause a segfault when quitting, and added a check to avoid that.

There's more info in the linked issue, but basically when a corruption was detected, some of the data was deleted (for example all ancient blocks), but some were left there hanging (data from newer blocks). This caused syncing failures where the node became stuck.

Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for working on this!

@nategraf nategraf merged commit 81d41a4 into master Jul 2, 2020
@mrsmkl mrsmkl deleted the mrsmkl/corruption-handling-fix branch July 2, 2020 18:41
kevjue pushed a commit that referenced this pull request Jul 17, 2020
@mcortesi mcortesi added this to the 1.0.2 milestone Sep 24, 2020
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.

Celo blockchain client periodically disconnects from peer with "retrieved hash chain is invalid" error
3 participants