[#959] node: Set mode to shard's components when open it

Avoid opening database for `metabase` and `cache` in `Degraded` mode.

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-02-09 09:17:17 +03:00 committed by Evgenii Stratonikov
parent 60527abb65
commit d19ade23c8
25 changed files with 219 additions and 74 deletions

View file

@ -8,6 +8,7 @@ import (
"sync/atomic"
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard/mode"
cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test"
"github.com/stretchr/testify/require"
)
@ -26,7 +27,7 @@ func BenchmarkCreate(b *testing.B) {
f := NewBoltForest(
WithPath(filepath.Join(tmpDir, "test.db")),
WithMaxBatchSize(runtime.GOMAXPROCS(0)))
require.NoError(b, f.Open(context.Background(), false))
require.NoError(b, f.Open(context.Background(), mode.ReadWrite))
require.NoError(b, f.Init())
defer func() { require.NoError(b, f.Close()) }()