forked from TrueCloudLab/frostfs-node
[#1938] meta: Make version error messages more descriptive
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
f396ffcc0f
commit
f8180447a1
2 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ var versionKey = []byte("version")
|
||||||
// ErrOutdatedVersion is returned on initializing
|
// ErrOutdatedVersion is returned on initializing
|
||||||
// an existing metabase that is not compatible with
|
// an existing metabase that is not compatible with
|
||||||
// the current code version.
|
// the current code version.
|
||||||
var ErrOutdatedVersion = errors.New("invalid version")
|
var ErrOutdatedVersion = errors.New("invalid version, resynchronization is required")
|
||||||
|
|
||||||
func checkVersion(tx *bbolt.Tx, initialized bool) error {
|
func checkVersion(tx *bbolt.Tx, initialized bool) error {
|
||||||
var knownVersion bool
|
var knownVersion bool
|
||||||
|
|
|
@ -117,7 +117,7 @@ func (s *Shard) Init() error {
|
||||||
if err := component.Init(); err != nil {
|
if err := component.Init(); err != nil {
|
||||||
if component == s.metaBase {
|
if component == s.metaBase {
|
||||||
if errors.Is(err, meta.ErrOutdatedVersion) {
|
if errors.Is(err, meta.ErrOutdatedVersion) {
|
||||||
return err
|
return fmt.Errorf("metabase initialization: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.handleMetabaseFailure("init", err)
|
err = s.handleMetabaseFailure("init", err)
|
||||||
|
|
Loading…
Reference in a new issue