[#569] writecache: Allow to seal writecache after flush
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
b118734909
commit
0cb0fc1735
12 changed files with 436 additions and 344 deletions
|
@ -147,7 +147,7 @@ func runFlushTest[Option any](
|
|||
require.NoError(t, bs.SetMode(mode.ReadWrite))
|
||||
require.NoError(t, mb.SetMode(mode.ReadWrite))
|
||||
|
||||
require.NoError(t, wc.Flush(context.Background(), false))
|
||||
require.NoError(t, wc.Flush(context.Background(), false, false))
|
||||
|
||||
check(t, mb, bs, objects)
|
||||
})
|
||||
|
@ -159,8 +159,6 @@ func runFlushTest[Option any](
|
|||
// Blobstor is read-only, so we expect en error from `flush` here.
|
||||
require.Error(t, wc.SetMode(mode.Degraded))
|
||||
|
||||
// First move to read-only mode to close background workers.
|
||||
require.NoError(t, wc.SetMode(mode.ReadOnly))
|
||||
require.NoError(t, bs.SetMode(mode.ReadWrite))
|
||||
require.NoError(t, mb.SetMode(mode.ReadWrite))
|
||||
require.NoError(t, wc.SetMode(mode.Degraded))
|
||||
|
@ -177,14 +175,13 @@ func runFlushTest[Option any](
|
|||
objects := putObjects(t, wc)
|
||||
f.InjectFn(t, wc)
|
||||
|
||||
require.NoError(t, wc.SetMode(mode.ReadOnly))
|
||||
require.NoError(t, bs.SetMode(mode.ReadWrite))
|
||||
require.NoError(t, mb.SetMode(mode.ReadWrite))
|
||||
|
||||
require.Equal(t, uint32(0), errCount.Load())
|
||||
require.Error(t, wc.Flush(context.Background(), false))
|
||||
require.Error(t, wc.Flush(context.Background(), false, false))
|
||||
require.Greater(t, errCount.Load(), uint32(0))
|
||||
require.NoError(t, wc.Flush(context.Background(), true))
|
||||
require.NoError(t, wc.Flush(context.Background(), true, false))
|
||||
|
||||
check(t, mb, bs, objects)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue