From b9fcaad21f03da4bf1562700c76b6e61e5cdc47e 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 bc9ab2b9..6f579a8c 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 f2203f4d..1f444a3e 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 fe6bf4fe..d4ae35ff 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 f2b48d74..254d8754 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{