From 2eb83624cf265ce3d54f953787e85ab23e6f6114 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 30 Nov 2020 20:03:15 +0300 Subject: [PATCH] [#220] cmd/neofs-node: Configure Shard's write cache usage Signed-off-by: Leonard Lyubich --- cmd/neofs-node/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 1ee51a652..9886c56e6 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -114,6 +114,8 @@ const ( cfgLocalStorageSection = "storage" cfgStorageShardSection = "shard" + cfgShardUseWriteCache = "use_write_cache" + cfgBlobStorSection = "blobstor" cfgBlobStorCompress = "compress" cfgBlobStorShallowDepth = "shallow_depth" @@ -436,6 +438,10 @@ func initShardOptions(c *cfg) { strconv.Itoa(i), ) + useCache := c.viper.GetBool( + configPath(prefix, cfgShardUseWriteCache), + ) + blobPrefix := configPath(prefix, cfgBlobStorSection) blobPath := c.viper.GetString( @@ -510,9 +516,11 @@ func initShardOptions(c *cfg) { meta.WithPath(metaPath), meta.WithPermissions(metaPerm), ), + shard.WithWriteCache(useCache), }) c.log.Info("storage shard options", + zap.Bool("with write cache", useCache), zap.String("BLOB path", blobPath), zap.Stringer("BLOB permissions", blobPerm), zap.Bool("BLOB compress", compressObjects),