From 707936f48218b907a6222b392a0083e31dccf901 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 3 Oct 2020 14:12:38 -0700 Subject: [PATCH] re-enable caching larger than 16MB revert https://github.com/chrislusf/seaweedfs/commit/62ce85610e2fcd08488ee6026266e617509f6d46 --- weed/util/chunk_cache/chunk_cache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/util/chunk_cache/chunk_cache.go b/weed/util/chunk_cache/chunk_cache.go index 608d605b1..3615aee0e 100644 --- a/weed/util/chunk_cache/chunk_cache.go +++ b/weed/util/chunk_cache/chunk_cache.go @@ -76,7 +76,7 @@ func (c *TieredChunkCache) doGetChunk(fileId string, minSize uint64) (data []byt return data } } - if minSize <= c.onDiskCacheSizeLimit2 { + { data = c.diskCaches[2].getChunk(fid.Key) if len(data) >= int(minSize) { return data @@ -115,7 +115,7 @@ func (c *TieredChunkCache) doSetChunk(fileId string, data []byte) { c.diskCaches[0].setChunk(fid.Key, data) } else if len(data) <= int(c.onDiskCacheSizeLimit1) { c.diskCaches[1].setChunk(fid.Key, data) - } else if len(data) <= int(c.onDiskCacheSizeLimit2) { + } else { c.diskCaches[2].setChunk(fid.Key, data) }