forked from TrueCloudLab/frostfs-node
[#222] Add shard amount check
There should be at least one correctly set up shard in node config. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
6bec50963b
commit
4114028a63
1 changed files with 6 additions and 0 deletions
|
@ -449,6 +449,7 @@ func initShardOptions(c *cfg) {
|
||||||
configPath(writeCachePrefix, cfgBlobStorTreePath),
|
configPath(writeCachePrefix, cfgBlobStorTreePath),
|
||||||
)
|
)
|
||||||
if useCache && writeCachePath == "" {
|
if useCache && writeCachePath == "" {
|
||||||
|
c.log.Warn("incorrect writeCache path, ignore shard")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,6 +459,7 @@ func initShardOptions(c *cfg) {
|
||||||
configPath(blobPrefix, cfgBlobStorTreePath),
|
configPath(blobPrefix, cfgBlobStorTreePath),
|
||||||
)
|
)
|
||||||
if blobPath == "" {
|
if blobPath == "" {
|
||||||
|
c.log.Warn("incorrect blobStor path, ignore shard")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,6 +547,10 @@ func initShardOptions(c *cfg) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(opts) == 0 {
|
||||||
|
fatalOnErr(errors.New("no correctly set up shards, exit"))
|
||||||
|
}
|
||||||
|
|
||||||
c.cfgObject.cfgLocalStorage.shardOpts = opts
|
c.cfgObject.cfgLocalStorage.shardOpts = opts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue