diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f47e7d697..84cf851cb0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Changelog for NeoFS Node ### Changed - FSTree storage now uses more efficient and safe temporary files under Linux (#2566) +- BoltDB timeout increased from 100ms to 1s (#2499) ### Removed diff --git a/cmd/neofs-lens/internal/meta/root.go b/cmd/neofs-lens/internal/meta/root.go index 3df4a6df6b1..462d993728a 100644 --- a/cmd/neofs-lens/internal/meta/root.go +++ b/cmd/neofs-lens/internal/meta/root.go @@ -46,7 +46,7 @@ func openMeta(cmd *cobra.Command, readOnly bool) *meta.DB { meta.WithPath(vPath), meta.WithBoltDBOptions(&bbolt.Options{ ReadOnly: readOnly, - Timeout: 100 * time.Millisecond, + Timeout: 1000 * time.Millisecond, }), meta.WithEpochState(epochState{}), ) diff --git a/cmd/neofs-lens/internal/storage/root.go b/cmd/neofs-lens/internal/storage/root.go index 4430924973c..d29e0f34034 100644 --- a/cmd/neofs-lens/internal/storage/root.go +++ b/cmd/neofs-lens/internal/storage/root.go @@ -246,7 +246,7 @@ func openEngine(cmd *cobra.Command) *engine.StorageEngine { meta.WithMaxBatchSize(shCfg.MetaCfg.MaxBatchSize), meta.WithMaxBatchDelay(shCfg.MetaCfg.MaxBatchDelay), meta.WithBoltDBOptions(&bbolt.Options{ - Timeout: 100 * time.Millisecond, + Timeout: 1000 * time.Millisecond, }), meta.WithEpochState(epochState{}), diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 5531be73d4b..b328ec50119 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -701,7 +701,7 @@ func (c *cfg) shardOpts() []shardOptsWithID { meta.WithMaxBatchSize(shCfg.MetaCfg.MaxBatchSize), meta.WithMaxBatchDelay(shCfg.MetaCfg.MaxBatchDelay), meta.WithBoltDBOptions(&bbolt.Options{ - Timeout: 100 * time.Millisecond, + Timeout: 1000 * time.Millisecond, }), meta.WithLogger(c.log), diff --git a/cmd/neofs-node/session.go b/cmd/neofs-node/session.go index df57557130b..a3ba9faf0a4 100644 --- a/cmd/neofs-node/session.go +++ b/cmd/neofs-node/session.go @@ -30,7 +30,7 @@ func initSessionService(c *cfg) { if persistentSessionPath := nodeconfig.PersistentSessions(c.appCfg).Path(); persistentSessionPath != "" { persisessions, err := persistent.NewTokenStore(persistentSessionPath, persistent.WithLogger(c.log), - persistent.WithTimeout(100*time.Millisecond), + persistent.WithTimeout(1000*time.Millisecond), persistent.WithEncryptionKey(&c.key.PrivateKey), ) if err != nil { diff --git a/pkg/local_object_storage/blobovnicza/blobovnicza.go b/pkg/local_object_storage/blobovnicza/blobovnicza.go index 5b7b5ca9a04..29610841e69 100644 --- a/pkg/local_object_storage/blobovnicza/blobovnicza.go +++ b/pkg/local_object_storage/blobovnicza/blobovnicza.go @@ -45,7 +45,7 @@ func defaultCfg(c *cfg) { boltDBCfg: boltDBCfg{ perm: os.ModePerm, // 0777 boltOptions: &bbolt.Options{ - Timeout: 100 * time.Millisecond, + Timeout: 1000 * time.Millisecond, }, }, fullSizeLimit: 1 << 30, // 1GB diff --git a/pkg/local_object_storage/blobstor/peapod/peapod.go b/pkg/local_object_storage/blobstor/peapod/peapod.go index 2e9280ff27f..a6d3c57a194 100644 --- a/pkg/local_object_storage/blobstor/peapod/peapod.go +++ b/pkg/local_object_storage/blobstor/peapod/peapod.go @@ -199,7 +199,7 @@ func (x *Peapod) Open(readOnly bool) error { x.bolt, err = bbolt.Open(x.path, x.perm, &bbolt.Options{ ReadOnly: readOnly, - Timeout: 100 * time.Millisecond, // to handle flock + Timeout: 1000 * time.Millisecond, // to handle flock }) if err != nil { return fmt.Errorf("open BoltDB instance: %w", err) diff --git a/pkg/local_object_storage/engine/control_test.go b/pkg/local_object_storage/engine/control_test.go index 55cf727e20e..f9cb82de2ee 100644 --- a/pkg/local_object_storage/engine/control_test.go +++ b/pkg/local_object_storage/engine/control_test.go @@ -47,7 +47,7 @@ func TestInitializationFailure(t *testing.T) { newStorages(c.blobstor, 1<<20))), shard.WithMetaBaseOptions( meta.WithBoltDBOptions(&bbolt.Options{ - Timeout: 100 * time.Millisecond, + Timeout: 1000 * time.Millisecond, }), meta.WithPath(c.metabase), meta.WithPermissions(0700), diff --git a/pkg/local_object_storage/pilorama/boltdb.go b/pkg/local_object_storage/pilorama/boltdb.go index 88c6b374313..02d73cea5c4 100644 --- a/pkg/local_object_storage/pilorama/boltdb.go +++ b/pkg/local_object_storage/pilorama/boltdb.go @@ -106,7 +106,7 @@ func (t *boltForest) Open(readOnly bool) error { opts := *bbolt.DefaultOptions opts.ReadOnly = readOnly opts.NoSync = t.noSync - opts.Timeout = 100 * time.Millisecond + opts.Timeout = 1000 * time.Millisecond t.db, err = bbolt.Open(t.path, t.perm, &opts) if err != nil { diff --git a/pkg/local_object_storage/writecache/util.go b/pkg/local_object_storage/writecache/util.go index bc6da4aa881..b4a055b2416 100644 --- a/pkg/local_object_storage/writecache/util.go +++ b/pkg/local_object_storage/writecache/util.go @@ -13,6 +13,6 @@ func OpenDB(p string, ro bool) (*bbolt.DB, error) { return bbolt.Open(filepath.Join(p, dbName), os.ModePerm, &bbolt.Options{ NoFreelistSync: true, ReadOnly: ro, - Timeout: 100 * time.Millisecond, + Timeout: 1000 * time.Millisecond, }) } diff --git a/pkg/services/session/storage/persistent/options.go b/pkg/services/session/storage/persistent/options.go index 61a0969c973..797edb25323 100644 --- a/pkg/services/session/storage/persistent/options.go +++ b/pkg/services/session/storage/persistent/options.go @@ -19,7 +19,7 @@ type Option func(*cfg) func defaultCfg() *cfg { return &cfg{ l: zap.L(), - timeout: 100 * time.Millisecond, + timeout: 1000 * time.Millisecond, } }