Skip to content
Draft
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 objstorage/objstorageprovider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ type Settings struct {
// 2*runtime.GOMAXPROCS is used as the shard count.
CacheShardCount int

// If true, metadata on the mapping from logical block indexes to cache block indexes
// is persisted, implying that the contents in the cache are usable after a server
// restart.
PersistMetadata bool

// TODO(radu): allow the cache to live on another FS/location (e.g. to use
// instance-local SSD).
}
Expand Down
3 changes: 2 additions & 1 deletion objstorage/objstorageprovider/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ func (p *provider) sharedInit() error {
numShards = 2 * runtime.GOMAXPROCS(0)
}

p.shared.cache, err = sharedcache.Open(p.st.FS, p.st.FSDirName, blockSize, p.st.Shared.CacheSizeBytes, numShards)
p.shared.cache, err = sharedcache.Open(
p.st.FS, p.st.FSDirName, blockSize, p.st.Shared.CacheSizeBytes, numShards, p.st.Shared.PersistMetadata)
if err != nil {
return errors.Wrapf(err, "pebble: could not open shared object cache")
}
Expand Down
Loading