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

blockchain: Make version 5 update atomic. #1529

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Nov 15, 2018

This modifies the version 5 migration code to update the database version atomically with setting a reindex tip and resetting the best chain tip back to the genesis block so the chain can be reindexed.

This is necessary because, unlike the modifications that come before it, storing the current chain tip and resetting it is not idempotent, so lack of atomicity in those updates can lead to failure to recover in unclean shutdown circumstances.

Thanks to @alexlyp for providing the logs which triggered the condition and helping test the resolution.

@davecgh davecgh added this to the 1.4.0 milestone Nov 15, 2018
This modifies the version 5 migration code to update the database
version atomically with setting a reindex tip and resetting the best
chain tip back to the genesis block so the chain can be reindexed.

This is necessary because, unlike the modifications that come before it,
storing the current chain tip and resetting it is not idempotent, so
lack of atomicity in those updates can lead to failure to recover in
unclean shutdown circumstances.
Copy link
Member

@alexlyp alexlyp left a comment

Choose a reason for hiding this comment

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

tACK, confirmed fix for reproducible issue on mainnet.

SIG-ABRT just after the first Deleted 200000 keys....

@davecgh davecgh merged commit ba4fc10 into decred:master Nov 15, 2018
@davecgh davecgh deleted the blockchain_atomic_version branch November 15, 2018 20:00
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.

2 participants