Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/snapshots/storage/metastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ func NewMetaStore(dbfile string, opts ...Opt) (*MetaStore, error) {
opts: *bolt.DefaultOptions,
}

// Disable stat usage since we never consume the data.
// This can reduce unnecessary contention during transactions.
// https://github.com/etcd-io/bbolt/pull/977
store.opts.NoStatistics = true

for _, f := range opts {
if err := f(&store.opts); err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions plugins/metadata/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ func init() {
// Without the timeout, bbolt.Open would block indefinitely due to flock(2).
options.Timeout = timeout.Get(boltOpenTimeout)

// Disable stat usage since we never consume the data.
// This can reduce unnecessary contention during transactions.
// https://github.com/etcd-io/bbolt/pull/977
options.NoStatistics = true

shared := true
ic.Meta.Exports["policy"] = SharingPolicyShared
if cfg, ok := ic.Config.(*BoltConfig); ok {
Expand Down
9 changes: 8 additions & 1 deletion plugins/mount/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ func init() {

metadb := filepath.Join(root, "mounts.db")

db, err := bolt.Open(metadb, 0600, nil)
options := *bolt.DefaultOptions

// Disable stat usage since we never consume the data.
// This can reduce unnecessary contention during transactions.
// https://github.com/etcd-io/bbolt/pull/977
options.NoStatistics = true

db, err := bolt.Open(metadb, 0600, &options)
if err != nil {
return nil, fmt.Errorf("failed to open database file: %w", err)
}
Expand Down
Loading