[#1559] local_object_storage: Provide readOnly flag to Open

We should be able to reopen storage in readonly in runtime.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-06-28 16:42:50 +03:00 committed by fyrchik
parent e38b0aa4ba
commit 1e786233bf
20 changed files with 70 additions and 49 deletions

View file

@ -34,7 +34,7 @@ func TestIterateObjects(t *testing.T) {
defer os.RemoveAll(p)
// open Blobstor
require.NoError(t, blobStor.Open())
require.NoError(t, blobStor.Open(false))
// initialize Blobstor
require.NoError(t, blobStor.Init())
@ -111,7 +111,7 @@ func TestIterate_IgnoreErrors(t *testing.T) {
WithBlobovniczaShallowWidth(1),
WithBlobovniczaShallowDepth(1)}
bs := New(bsOpts...)
require.NoError(t, bs.Open())
require.NoError(t, bs.Open(false))
require.NoError(t, bs.Init())
addrs := make([]oid.Address, objCount)
@ -148,7 +148,7 @@ func TestIterate_IgnoreErrors(t *testing.T) {
// Increase width to have blobovnicza which is definitely empty.
b := New(append(bsOpts, WithBlobovniczaShallowWidth(2))...)
require.NoError(t, b.Open())
require.NoError(t, b.Open(false))
require.NoError(t, b.Init())
var p string
@ -163,7 +163,7 @@ func TestIterate_IgnoreErrors(t *testing.T) {
require.NoError(t, os.Chmod(p, 0))
require.NoError(t, b.Close())
require.NoError(t, bs.Open())
require.NoError(t, bs.Open(false))
require.NoError(t, bs.Init())
var prm IteratePrm