Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curvefs/client: local cache policy optimization #2025

Closed
wuhongsong opened this issue Nov 3, 2022 · 5 comments
Closed

curvefs/client: local cache policy optimization #2025

wuhongsong opened this issue Nov 3, 2022 · 5 comments
Assignees
Labels
enhancement improve feature good first issue Good for newcomers

Comments

@wuhongsong
Copy link
Contributor

wuhongsong commented Nov 3, 2022

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

@Tangruilin
Copy link
Contributor

assign to me

@Tangruilin
Copy link
Contributor

我看了一下代码,这个 issue 的解决思路我已经有了。
但是有一个问题:cacheread + cachewrite 模式下的接口已经有的,我如果要针对 cacheread 模式新设置一个接口,会复用很多代码,我对 curve 的代码本身并不是特别熟悉,我先写一版,然后这边给我一些 review 意见可以吗。

@wuhongsong
Copy link
Contributor Author

我看了一下代码,这个 issue 的解决思路我已经有了。 但是有一个问题:cacheread + cachewrite 模式下的接口已经有的,我如果要针对 cacheread 模式新设置一个接口,会复用很多代码,我对 curve 的代码本身并不是特别熟悉,我先写一版,然后这边给我一些 review 意见可以吗。

thanks for your contribution.
and no need a new function interface, you can use the WriteReadDirect function directly

@Tangruilin
Copy link
Contributor

我看了一下代码,这个 issue 的解决思路我已经有了。 但是有一个问题:cacheread + cachewrite 模式下的接口已经有的,我如果要针对 cacheread 模式新设置一个接口,会复用很多代码,我对 curve 的代码本身并不是特别熟悉,我先写一版,然后这边给我一些 review 意见可以吗。

thanks for your contribution. and no need a new function interface, you can use the WriteReadDirect function directly

use the WriteReadDirect directly is sync. May I should refer to the desgin of cacheread + cachewrite (function DiskCacheManagerImpl::Enqueue) to do this.

@wuhongsong
Copy link
Contributor Author

我看了一下代码,这个 issue 的解决思路我已经有了。 但是有一个问题:cacheread + cachewrite 模式下的接口已经有的,我如果要针对 cacheread 模式新设置一个接口,会复用很多代码,我对 curve 的代码本身并不是特别熟悉,我先写一版,然后这边给我一些 review 意见可以吗。

thanks for your contribution. and no need a new function interface, you can use the WriteReadDirect function directly

use the WriteReadDirect directly is sync. May I should refer to the desgin of cacheread + cachewrite (function DiskCacheManagerImpl::Enqueue) to do this.

Yes, you're right, Let's do it.
Sorry, it's taking so long to reply you, today is so busy.

Tangruilin added a commit to Tangruilin/curve that referenced this issue Nov 12, 2022
Tangruilin added a commit to Tangruilin/curve that referenced this issue Nov 12, 2022
Tangruilin added a commit to Tangruilin/curve that referenced this issue Nov 14, 2022
Tangruilin added a commit to Tangruilin/curve that referenced this issue Nov 14, 2022
Tangruilin added a commit to Tangruilin/curve that referenced this issue Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants