-
Notifications
You must be signed in to change notification settings - Fork 108
Z/hypersync db settings fix #900
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
Conversation
| performanceOptions, err := lib.DbInitializedWithPerformanceOptions(node.Config.DataDirectory) | ||
|
|
||
| // If the db options haven't yet been saved, we should base the options on the sync type. | ||
| if os.IsNotExist(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever we encounter an annoying bug like this I basically like to leave the post-mortem in a long comment next to the change. Here, I would explain that the reason why you need to save the options to disk is because Badger breaks if you (a) shutdown (b) without closing (c) and then re-open with different options.
The other reason why this is good is it gives us the confidence to delete hacks like this in the future, rather than being scared that we'll break something if we do.
Co-authored-by: Lazy Nina <81658138+lazynina@users.noreply.github.com>
…-protocol/core into z/hypersync-db-settings-fix
Fix badger db options for node restarts when hypersyncing.