From 3d77fdb347daa6279dfd4a135e74bfd36825f760 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 1 Dec 2020 19:14:42 +0300 Subject: [PATCH] [#222] Set write cache specific config on application level Signed-off-by: Alex Vanin --- cmd/neofs-node/config.go | 2 ++ pkg/local_object_storage/shard/shard.go | 6 +----- pkg/local_object_storage/shard/shard_test.go | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index eadc46ff5..9bcdf6826 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -531,6 +531,8 @@ func initShardOptions(c *cfg) { shard.WithWriteCache(useCache), shard.WithWriteCacheOptions( blobstor.WithRootPath(writeCachePath), + blobstor.WithBlobovniczaShallowDepth(0), + blobstor.WithBlobovniczaShallowWidth(1), ), }) diff --git a/pkg/local_object_storage/shard/shard.go b/pkg/local_object_storage/shard/shard.go index d245d74a1..5496a7bf7 100644 --- a/pkg/local_object_storage/shard/shard.go +++ b/pkg/local_object_storage/shard/shard.go @@ -53,11 +53,7 @@ func New(opts ...Option) *Shard { if c.useWriteCache { writeCache = blobstor.New( - append(c.blobOpts, append( - c.writeCacheOpts, - blobstor.WithBlobovniczaShallowDepth(0), - blobstor.WithBlobovniczaShallowWidth(1))..., - )..., + append(c.blobOpts, c.writeCacheOpts...)..., ) } diff --git a/pkg/local_object_storage/shard/shard_test.go b/pkg/local_object_storage/shard/shard_test.go index 1e08c659e..1fabd16aa 100644 --- a/pkg/local_object_storage/shard/shard_test.go +++ b/pkg/local_object_storage/shard/shard_test.go @@ -42,6 +42,8 @@ func newShard(t testing.TB, enableWriteCache bool) *shard.Shard { shard.WithWriteCache(enableWriteCache), shard.WithWriteCacheOptions( blobstor.WithRootPath(path.Join(rootPath, "wcache")), + blobstor.WithBlobovniczaShallowWidth(1), + blobstor.WithBlobovniczaShallowDepth(0), ), }