[#2068] writecache: Allow to open FSTree in read-only mode

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
remotes/KirillovDenis/feature/2130-adm-nns-redeployment
Evgenii Stratonikov 2022-11-17 11:58:56 +03:00 committed by fyrchik
parent 857d2dc3f5
commit 4a49ea0855
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ func (c *cache) openStore(readOnly bool) error {
fstree.WithDepth(1),
fstree.WithDirNameLen(1),
fstree.WithNoSync(c.noSync))
if err := c.fsTree.Open(readOnly); err != nil {
return fmt.Errorf("could not open FSTree: %w", err)
}
// Write-cache can be opened multiple times during `SetMode`.
// flushed map must not be re-created in this case.