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

Fix/Do not boot up if metabase is outdated #1809

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Fix/Do not boot up if metabase is outdated #1809

merged 1 commit into from
Oct 4, 2022

Conversation

carpawell
Copy link
Member

No description provided.

@carpawell carpawell added bug Something isn't working neofs-storage Storage node application issues 2022Q3 labels Sep 21, 2022
@carpawell carpawell self-assigned this Sep 21, 2022
@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #1809 (320ce95) into master (2e3ef81) will decrease coverage by 0.00%.
The diff coverage is 33.33%.

@@            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              
Impacted Files Coverage Δ
pkg/local_object_storage/metabase/control.go 77.77% <ø> (ø)
pkg/local_object_storage/shard/control.go 75.17% <0.00%> (-1.09%) ⬇️
pkg/local_object_storage/metabase/version.go 88.88% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@carpawell carpawell marked this pull request as ready for review September 21, 2022 21:03
@alexchetaev alexchetaev added U3 Regular and removed 2022Q3 labels Sep 21, 2022
acid-ant
acid-ant previously approved these changes Sep 22, 2022
CHANGELOG.md Outdated
@@ -9,6 +9,8 @@ Changelog for NeoFS Node

### Fixed

- Outdated metabase start up (#1809)
Copy link
Contributor

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"?

Comment on lines 15 to 23
// 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)
Copy link
Contributor

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, ...)?

Copy link
Contributor

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>
@fyrchik fyrchik merged commit 4eb0ed1 into nspcc-dev:master Oct 4, 2022
@carpawell carpawell deleted the fix/do-not-start-with-non-updated-meta branch October 4, 2022 09:32
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working neofs-storage Storage node application issues U3 Regular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants