when reflecting a sdblob, insert all the stream and intermediate blobs using a transaction #50

Closed
shyba wants to merge 39 commits from insert_under_tx into master
Showing only changes of commit d45abdbdb0 - Show all commits

View file

@ -151,6 +151,7 @@ func wrapWithCache(s store.BlobStore) store.BlobStore {
wrapped := s wrapped := s
diskCacheMaxSize, diskCachePath := diskCacheParams(reflectorCmdDiskCache) diskCacheMaxSize, diskCachePath := diskCacheParams(reflectorCmdDiskCache)
cacheMaxSizeInBytes := float64(diskCacheMaxSize * 2 * 1000 * 1000)
if diskCacheMaxSize > 0 { if diskCacheMaxSize > 0 {
err := os.MkdirAll(diskCachePath, os.ModePerm) err := os.MkdirAll(diskCachePath, os.ModePerm)
if err != nil { if err != nil {
@ -159,7 +160,7 @@ func wrapWithCache(s store.BlobStore) store.BlobStore {
wrapped = store.NewCachingStore( wrapped = store.NewCachingStore(
"reflector", "reflector",
wrapped, wrapped,
store.NewLRUStore("hdd", store.NewDiskStore(diskCachePath, 2), diskCacheMaxSize), store.NewLFUDAStore("hdd", store.NewDiskStore(diskCachePath, 2), cacheMaxSizeInBytes),
) )
} }
@ -172,7 +173,7 @@ func wrapWithCache(s store.BlobStore) store.BlobStore {
wrapped = store.NewCachingStore( wrapped = store.NewCachingStore(
"reflector", "reflector",
wrapped, wrapped,
store.NewLRUStore("nvme", store.NewDiskStore(diskCachePath, 2), diskCacheMaxSize), store.NewLFUDAStore("nvme", store.NewDiskStore(diskCachePath, 2), cacheMaxSizeInBytes),
) )
} }