-
Notifications
You must be signed in to change notification settings - Fork 131
feat(l1)!: fail opening DB without schema version #5597
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
Changes from all commits
48bdfc8
33af0c3
eca1b7e
6e434ab
4ddd39c
c7040a0
ff23927
428ca59
1c4dba8
0443c25
5f6805d
09fb05c
23893fd
7e455a4
feeddd4
324ac4b
d64153d
092688c
5a61b26
4acf291
1797218
7970fd5
e829c3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,3 +17,6 @@ pub use store::{ | |
| /// Store Schema Version, must be updated on any breaking change | ||
| /// An upgrade to a newer schema version invalidates currently stored data, requiring a re-sync. | ||
| pub const STORE_SCHEMA_VERSION: u64 = 1; | ||
|
|
||
| /// Name of the file storing the metadata about the database | ||
| pub const STORE_METADATA_FILENAME: &str = "metadata.json"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the place for the schema versioning is the DB. Decoupling it is asking for trouble. E.g., I don't see the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The main reason to move the schema versioning to another file is to make it backend-agnostic. Keeping it inside the DB means we need to open a It also has the benefit that we can include more information, like the engine type we're using, and we can easily inspect it because we use plaintext. Having it in filenames is a good alternative, but I don't see the benefits in moving to that. |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
We start at 1 so we can treat 0 and missing as equivalent, so I don't think the new error kind is necessary.
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.
It makes the distinction clear and also simplifies the formatting of the error here.