-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix/Do not boot up if metabase is outdated #1809
Fix/Do not boot up if metabase is outdated #1809
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1809 +/- ##
==========================================
- Coverage 31.06% 31.06% -0.01%
==========================================
Files 374 374
Lines 26377 26379 +2
==========================================
Hits 8195 8195
- Misses 17492 17494 +2
Partials 690 690
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
CHANGELOG.md
Outdated
@@ -9,6 +9,8 @@ Changelog for NeoFS Node | |||
|
|||
### Fixed | |||
|
|||
- Outdated metabase start up (#1809) |
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.
"fail startup if metabase has old version"?
// ErrOutdatedVersion is returned on initializing | ||
// an existing metabase that is not compatible with | ||
// the current code version. | ||
type ErrOutdatedVersion struct { | ||
stored uint64 | ||
} | ||
|
||
func (e ErrOutdatedVersion) Error() string { | ||
return fmt.Sprintf("invalid version: expected=%d, stored=%d", version, e.stored) |
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.
I don't like complex error types, what about var ErrOutdatedVersion = errors.New("invalid version")
+ return fmt.Errorf("%w: expected...", ErrOutdatedVersion, ...)
?
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.
Here I agree with @fyrchik at least since we don't decode the error structure. We could use errors.Is
.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
No description provided.