diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index 47f84827..f5c106f7 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -734,7 +734,6 @@ func (c *cfg) getWriteCacheOpts(shCfg shardCfg) writecacheconfig.Options { writecachebadger.WithMaxObjectSize(wcRead.maxObjSize), writecachebadger.WithFlushWorkersCount(wcRead.flushWorkerCount), writecachebadger.WithMaxCacheSize(wcRead.sizeLimit), - writecachebadger.WithNoSync(wcRead.noSync), writecachebadger.WithLogger(c.log), writecachebadger.WithGCInterval(wcRead.gcInterval), ) diff --git a/pkg/local_object_storage/writecache/writecachebadger/options.go b/pkg/local_object_storage/writecache/writecachebadger/options.go index 635c1418..1737885b 100644 --- a/pkg/local_object_storage/writecache/writecachebadger/options.go +++ b/pkg/local_object_storage/writecache/writecachebadger/options.go @@ -47,8 +47,6 @@ type options struct { maxCacheSize uint64 // objCounters contains atomic counters for the number of objects stored in cache. objCounters counters - // noSync is true iff FSTree allows unsynchronized writes. - noSync bool // reportError is the function called when encountering disk errors in background workers. reportError func(string, error) // metrics is metrics implementation @@ -109,16 +107,6 @@ func WithMaxCacheSize(sz uint64) Option { } } -// WithNoSync sets an option to allow returning to caller on PUT before write is persisted. -// Note, that we use this flag for FSTree only and DO NOT use it for a bolt DB because -// we cannot yet properly handle the corrupted database during the startup. This SHOULD NOT -// be relied upon and may be changed in future. -func WithNoSync(noSync bool) Option { - return func(o *options) { - o.noSync = noSync - } -} - // WithReportErrorFunc sets error reporting function. func WithReportErrorFunc(f func(string, error)) Option { return func(o *options) { diff --git a/pkg/local_object_storage/writecache/writecachebadger/util.go b/pkg/local_object_storage/writecache/writecachebadger/util.go index 6d72c203..e55ed119 100644 --- a/pkg/local_object_storage/writecache/writecachebadger/util.go +++ b/pkg/local_object_storage/writecache/writecachebadger/util.go @@ -11,6 +11,7 @@ import ( func OpenDB(p string, ro bool, l *logger.Logger) (*badger.DB, error) { return badger.Open(badger.DefaultOptions(p). WithReadOnly(ro). + WithSyncWrites(true). WithLoggingLevel(badger.ERROR). WithLogger(badgerLoggerWrapper{l})) }