[#1992] writecache: Allow to open in NOSYNC mode

Applicable only to FSTree as we cannot handle corrupted databases
properly yet.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-28 13:09:38 +03:00 committed by fyrchik
parent b6930f2219
commit 98a152256b
8 changed files with 33 additions and 9 deletions

View file

@ -129,6 +129,7 @@ type shardCfg struct {
maxObjSize uint64
flushWorkerCount int
sizeLimit uint64
noSync bool
}
piloramaCfg struct {
@ -219,6 +220,7 @@ func (a *applicationConfiguration) readConfig(c *config.Config) error {
wc.smallObjectSize = writeCacheCfg.SmallObjectSize()
wc.flushWorkerCount = writeCacheCfg.WorkersNumber()
wc.sizeLimit = writeCacheCfg.SizeLimit()
wc.noSync = writeCacheCfg.NoSync()
}
// blobstor with substorages
@ -644,7 +646,7 @@ func (c *cfg) shardOpts() []shardOptsWithID {
writecache.WithSmallObjectSize(wcRead.smallObjectSize),
writecache.WithFlushWorkersCount(wcRead.flushWorkerCount),
writecache.WithMaxCacheSize(wcRead.sizeLimit),
writecache.WithNoSync(wcRead.noSync),
writecache.WithLogger(c.log),
)
}