mirror of
https://github.com/kopia/kopia.git
synced 2026-04-04 22:33:20 -04:00
content: added blob-level metadata cache (#421)
Unlike regular cache, which caches segments of blobs on a per-content basis, metadata cache will fetch and store the entire metadata blob (q) when any of the contents in it is accessed. Given that there are relatively few metadata blobs compared to data (p) blobs, this will reduce the traffic to the underlying store and improve performance of Snapshot GC which only relies on metadata contents.
This commit is contained in:
19
cli/command_cache_sync.go
Normal file
19
cli/command_cache_sync.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/kopia/kopia/repo"
|
||||
)
|
||||
|
||||
var (
|
||||
cacheSyncCommand = cacheCommands.Command("sync", "Synchronizes the metadata cache with blobs in storage")
|
||||
)
|
||||
|
||||
func runCacheSyncCommand(ctx context.Context, rep *repo.DirectRepository) error {
|
||||
return rep.Content.SyncMetadataCache(ctx)
|
||||
}
|
||||
|
||||
func init() {
|
||||
cacheSyncCommand.Action(directRepositoryAction(runCacheSyncCommand))
|
||||
}
|
||||
Reference in New Issue
Block a user