From e7e3bbbc2526bb965e14cd6ea1d0c8d886ab769d Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 10 Jun 2024 17:48:05 +0300 Subject: [PATCH] [#1168] shard: Set `Disabled` as default `mode` for components Signed-off-by: Anton Nikiforov --- pkg/local_object_storage/blobstor/blobstor.go | 1 + pkg/local_object_storage/metabase/db.go | 1 + pkg/local_object_storage/pilorama/boltdb.go | 1 + pkg/local_object_storage/writecache/cachebbolt.go | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/local_object_storage/blobstor/blobstor.go b/pkg/local_object_storage/blobstor/blobstor.go index bc9ab2b99..6f579a8ca 100644 --- a/pkg/local_object_storage/blobstor/blobstor.go +++ b/pkg/local_object_storage/blobstor/blobstor.go @@ -54,6 +54,7 @@ func initConfig(c *cfg) { // New creates, initializes and returns new BlobStor instance. func New(opts ...Option) *BlobStor { bs := new(BlobStor) + bs.mode = mode.Disabled initConfig(&bs.cfg) for i := range opts { diff --git a/pkg/local_object_storage/metabase/db.go b/pkg/local_object_storage/metabase/db.go index f2203f4d9..1f444a3ef 100644 --- a/pkg/local_object_storage/metabase/db.go +++ b/pkg/local_object_storage/metabase/db.go @@ -107,6 +107,7 @@ func New(opts ...Option) *DB { matchBucket: stringCommonPrefixMatcherBucket, }, }, + mode: mode.Disabled, } } diff --git a/pkg/local_object_storage/pilorama/boltdb.go b/pkg/local_object_storage/pilorama/boltdb.go index fe6bf4fed..d4ae35ff4 100644 --- a/pkg/local_object_storage/pilorama/boltdb.go +++ b/pkg/local_object_storage/pilorama/boltdb.go @@ -81,6 +81,7 @@ func NewBoltForest(opts ...Option) ForestStorage { openFile: os.OpenFile, metrics: &noopMetrics{}, }, + mode: mode.Disabled, } for i := range opts { diff --git a/pkg/local_object_storage/writecache/cachebbolt.go b/pkg/local_object_storage/writecache/cachebbolt.go index f2b48d746..254d8754f 100644 --- a/pkg/local_object_storage/writecache/cachebbolt.go +++ b/pkg/local_object_storage/writecache/cachebbolt.go @@ -60,7 +60,7 @@ var defaultBucket = []byte{0} func New(opts ...Option) Cache { c := &cache{ flushCh: make(chan objectInfo), - mode: mode.ReadWrite, + mode: mode.Disabled, compressFlags: make(map[string]struct{}), options: options{