-
Notifications
You must be signed in to change notification settings - Fork 234
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
feat: Track world state db versions and wipe the state upon version change #9946
Conversation
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.
LGTM, I'd change the file contents though to make them readable.
Aside from that, and not for this PR, should we add a "delete if incompatible" flag that defaults to false, so a configuration issue does not lead to the whole db being nuked?
public async writeVersionFile(filename: string) { | ||
await writeFile(filename, this.toBuffer()); | ||
} |
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.
Should we use a string representation instead, so the file is human-readable?
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.
Yeah, I agree
I'm wondering if actually we shouldn't delete the DB at all. Just log a big ERROR and quit the application. Let the user do the deleting? What do you think @alexghr @spalladino? |
Honestly, today I'd go with whatever is easier for the spartan deployments we're running. Given we're still working with very ephemeral networks, maybe we do want to delete it for convenience. |
On the one hand, I would prefer this (principle of least surprise), on the other hand, in k8s how convenient is it for people to manually log into their production cluster to delete a volume to restart their node? |
…-packages into pw/add-db-versioning
Implements a very basic mechanism of tracking changes to the world state DB structure and deleting the world state when a change is detected.