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:
Jarek Kowalski authored and GitHub committed 2020-04-20 02:18:43 -07:00
1 parent d707f3615a
commit a462798b28
9 files changed
+515 -250

No files matched your search

+19
View 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))
}