Skip to content

curvefs/client: local cache policy optimization #2025

@wuhongsong

Description

@wuhongsong

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)

when we set diskCache.diskCacheType only cacheread, then the write will not be cached in cacheread.
now, we need to cached the obj after write

Describe the solution you'd like (描述你期望的解决方法)

  1. what is the local cache policy

we have three strategies of the cache policy:

diskCache.diskCacheType=0 : no cache, we will write the obj to s3 directly, and read the obj from s3 directly.

diskCache.diskCacheType=1 : only cacheread, we cache the read s3 data to the read cache directory.

diskCache.diskCacheType=2 : cacheread + cachewrite, we cache the data we want to write to the write cache directory and upload it asynchronously to s3, at the same time, we're going to cache the write data to the read cache directory ;
we cache the read s3 data to the read cache directory

2 What are we going to do with this task

in DataCache::Flush, if the diskCache.diskCacheType is cacheread, we can call WriteReadDirect to cached the data in cachedread

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions