Skip to content

cephfs: add "entry_timeout" and "attr_timeout" options - #44593

Closed
xieshengGZ wants to merge 2 commits into
ceph:mainfrom
xieshengGZ:new44593
Closed

xieshengGZ wants to merge 2 commits into
ceph:mainfrom
xieshengGZ:new44593

Conversation

@xieshengGZ

@xieshengGZ xieshengGZ commented Jan 14, 2022 •

Copy link
Copy Markdown

Fuse provides the ability to cache the entry and attr, but cephfs is not used, so I add it to improve performance.

Thank lxbsz fix consistency problem: #44432

The following Fixed contains the test data before and after modification:
Fixes: https://tracker.ceph.com/issues/53730
Signed-off-by: Sheng Xie [email protected]

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@xiubli

xiubli commented Jan 17, 2022

Copy link
Copy Markdown
Member

jenkins test make check

@xiubli

xiubli commented Jan 17, 2022

Copy link
Copy Markdown
Member

jenkins test api

Comment thread src/client/fuse_ll.cc Resolved
Comment thread src/client/fuse_ll.cc Resolved
@xiubli
xiubli requested review from a team and jtlayton January 17, 2022 13:53
@xiubli

xiubli commented Jan 18, 2022

Copy link
Copy Markdown
Member

jenkins test api

@xiubli xiubli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the same please add one test in qa to make sure this won't introduce the issue in https://tracker.ceph.com/issues/53730#note-5.

Comment thread src/common/options/mds-client.yaml.in Resolved
Comment thread src/common/options/mds-client.yaml.in Resolved
@xiubli

xiubli commented Jan 18, 2022

Copy link
Copy Markdown
Member

LGTM.

At the same please add one test in qa to make sure this won't introduce the issue in https://tracker.ceph.com/issues/53730#note-5.

Please add the test case.

@xieshengGZ

Copy link
Copy Markdown
Author

At the same please add one test in qa to make sure this won't introduce the issue in https://tracker.ceph.com/issues/53730#note-5.

LGTM.

At the same please add one test in qa to make sure this won't introduce the issue in https://tracker.ceph.com/issues/53730#note-5.

Please add the test case.

I'll spend some time learning about how to add test cases.
Or this interesting thing doesn't necessarily need me to do?
My local environment compiles CEPH very slowly.

@xiubli

xiubli commented Jan 18, 2022

Copy link
Copy Markdown
Member

I'll spend some time learning about how to add test cases.
Or this interesting thing doesn't necessarily need me to do?

This looks good to me, no any new change needed from me.

My local environment compiles CEPH very slowly.

@xieshengGZ

xieshengGZ commented Jan 19, 2022 •

Copy link
Copy Markdown
Author

This looks good to me, no any new change needed from me.

Thank you so much, man!

@gregsfortytwo

Copy link
Copy Markdown
Member

I'm just a little worried about this one. I see that the config description does say "If directory entries are changed/deleted only as a result of requests that come through the kernel, this should be set to a very large value", but I'm not sure if that adequately conveys to users "your consistency will break if you have other clients on the same data". Is there some way we can gate this? :/

@xiubli

xiubli commented Feb 9, 2022

Copy link
Copy Markdown
Member

I'm just a little worried about this one. I see that the config description does say "If directory entries are changed/deleted only as a result of requests that come through the kernel, this should be set to a very large value", but I'm not sure if that adequately conveys to users "your consistency will break if you have other clients on the same data". Is there some way we can gate this? :/

Hmm, I think there still has one thing we need to make clear, that is if these two options are enabled and they are cached in kernel will it be possible that the new changes only be applied in kernel cache ? If the caches are readonly in kernel I think the #44432 should be enough.

@xieshengGZ Could you check this ?

@xieshengGZ

Copy link
Copy Markdown
Author

I'm just a little worried about this one. I see that the config description does say "If directory entries are changed/deleted only as a result of requests that come through the kernel, this should be set to a very large value", but I'm not sure if that adequately conveys to users "your consistency will break if you have other clients on the same data". Is there some way we can gate this? :/

Hmm, I think there still has one thing we need to make clear, that is if these two options are enabled and they are cached in kernel will it be possible that the new changes only be applied in kernel cache ? If the caches are readonly in kernel I think the #44432 should be enough.

@xieshengGZ Could you check this ?

I've already tested when both options are enabled,it won't be a problem. The new changes not only be applied in kernel cache,all cache will sync to other client.

@xiubli

xiubli commented Feb 9, 2022 •

Copy link
Copy Markdown
Member

I'm just a little worried about this one. I see that the config description does say "If directory entries are changed/deleted only as a result of requests that come through the kernel, this should be set to a very large value", but I'm not sure if that adequately conveys to users "your consistency will break if you have other clients on the same data". Is there some way we can gate this? :/

Hmm, I think there still has one thing we need to make clear, that is if these two options are enabled and they are cached in kernel will it be possible that the new changes only be applied in kernel cache ? If the caches are readonly in kernel I think the #44432 should be enough.

@xieshengGZ Could you check this ?

I went through the kernel fuse code, the fuse won't depend on them to cache the changes and it will always send a request to userspace when any attribute will be changed. That means all the related caches are readonly in kernel fuse.

Comment thread src/common/options/mds-client.yaml.in Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xieshengGZ This desc is not precise here. Please fix it.

Something like:

This will tell kernel how long could the dentry be cached in dcache, once enabled this should be set to a very large value.

@xieshengGZ xieshengGZ Feb 10, 2022 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well!Why should this value be set very large ?

@gregsfortytwo

Copy link
Copy Markdown
Member

I'm just a little worried about this one. I see that the config description does say "If directory entries are changed/deleted only as a result of requests that come through the kernel, this should be set to a very large value", but I'm not sure if that adequately conveys to users "your consistency will break if you have other clients on the same data". Is there some way we can gate this? :/

Hmm, I think there still has one thing we need to make clear, that is if these two options are enabled and they are cached in kernel will it be possible that the new changes only be applied in kernel cache ? If the caches are readonly in kernel I think the #44432 should be enough.

@xieshengGZ Could you check this ?

I don't think I was clear. With just this PR, my understanding is that the kernel will cache dentries for the given time period — so if the MDS revokes caps, the Client will drop its local caps and cache, but the actual programs running and making syscalls will read cached data out of the kernel without ever talking to our Client code.

Your related PR #44432 does schedule a cache drop in the kernel, but I believe that's asynchronous — so the cache drop could happen after the Client has replied to the MDS that it's stopped using caps and other system state has changed, while the local user has read cached data which is out of date.

Perhaps I'm misremembering or misunderstanding, but the kernel cache consistency has been an off-and-on-again problem with ceph-fuse for quite a while...

@xiubli

xiubli commented Feb 10, 2022 •

Copy link
Copy Markdown
Member

I'm just a little worried about this one. I see that the config description does say "If directory entries are changed/deleted only as a result of requests that come through the kernel, this should be set to a very large value", but I'm not sure if that adequately conveys to users "your consistency will break if you have other clients on the same data". Is there some way we can gate this? :/

Hmm, I think there still has one thing we need to make clear, that is if these two options are enabled and they are cached in kernel will it be possible that the new changes only be applied in kernel cache ? If the caches are readonly in kernel I think the #44432 should be enough.
@xieshengGZ Could you check this ?

I don't think I was clear. With just this PR, my understanding is that the kernel will cache dentries for the given time period — so if the MDS revokes caps, the Client will drop its local caps and cache, but the actual programs running and making syscalls will read cached data out of the kernel without ever talking to our Client code.

I just missed that they both should also depend on and get references for the relevant shared caps before caching and setting the timedouts in the lookup reply, or the timeouts should be disabled dynamically in the reply.

Your related PR #44432 does schedule a cache drop in the kernel, but I believe that's asynchronous

Yeah, right, I was aware of this problem. It should be handled synchronously in this case.

— so the cache drop could happen after the Client has replied to the MDS that it's stopped using caps and other system state has changed, while the local user has read cached data which is out of date.

Perhaps I'm misremembering or misunderstanding, but the kernel cache consistency has been an off-and-on-again problem with ceph-fuse for quite a while...

@xieshengGZ
xieshengGZ force-pushed the master branch 2 times, most recently from 891f38e to 5dc3196 Compare February 10, 2022 08:31

@xiubli xiubli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the issue mentioned in #44593 (comment).

@xieshengGZ

Copy link
Copy Markdown
Author

Please fix the issue mentioned in #44593 (comment).

Sorry, I'm not sure what needs to be fixed. Check whether the cache in the kernel is read-only?

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@xieshengGZ
xieshengGZ force-pushed the master branch 2 times, most recently from c5efe1e to ced6d6f Compare April 27, 2022 01:56
@xieshengGZ

Copy link
Copy Markdown
Author

Please fix the issue mentioned in #44593 (comment).

Sorry, I'm not sure what needs to be fixed. Check whether the cache in the kernel is read-only?

You should get the reference of the pLsAsFs caps before caching the dentries, etc, you need to dig it maybe there need a little more work to do.

I changed: Cache the dentries when the inode have CEPH_CAP_ANY_SHARED caps.

Fuse provides the ability to cache the entry and attr, but cephfs is not used, so I add it to improve performance.

Signed-off-by: Sheng Xie <[email protected]>
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@djgalloway
djgalloway changed the base branch from master to main May 27, 2022 16:10
@xieshengGZ

Copy link
Copy Markdown
Author

Hello everyone, let me summarize this pr.
our initial purpose is to improve the metadata query performance of the cephfs client.
Therefore, I propose use the dcache function provided by the fuse component to cache the attr and dentry information of the metadata file.
The results also prove that this method can indeed greatly improve the performance of the cephfs client.
But with the deepening of the problem, we found that after fuse caches metadata, many things need to be done to ensure the consistency of metadata under extreme conditions:

  1. Before fuse caches metadata, it is necessary to determine which cephfs client holds Whether caps has all the caps of the file.
  2. When other clients delete files, call the fuse callback function to delete the corresponding cache.
    The above changes to maintain the consistency of metadata will definitely affect our original purpose: to improve the performance of cephfs clients for querying metadata. Especially in the case of multiple cephfs clients, it may happen that most of the files do not meet the conditions for storing metadata in fuse, or the changes of caps need to be frequently deleted and newly created in the cache in fuse.
    So I began to reflect on this pr. At the beginning, my scenario was that for the same directory, only one client program would read and write at the same time.
    So I think: Can we simply add these two parameters and specify the applicable scenario in its description: only one client instance will read and write the same directory.
    In this way, users can optionally configure this parameter according to their own business scenarios. I know that many other optional parameters are also provided in this way, and the graduation business scenarios are different.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jan 11, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

@xieshengGZ Please rebase and add ceph/cephfs to reviewers so that this PR can move one step closer to getting merged. :)

@xieshengGZ

Copy link
Copy Markdown
Author

@xieshengGZ Please rebase and add ceph/cephfs to reviewers so that this PR can move one step closer to getting merged. :)
hai, what do I need to do now?

@mchangir

Copy link
Copy Markdown
Contributor

@xieshengGZ Please rebase and add ceph/cephfs to reviewers so that this PR can move one step closer to getting merged. :)
hai, what do I need to do now?

The commit: Merge branch 'main' into new44593 doesn't seem to be a correct rebase.

Remove the merge commit and instead do a git pull --rebase ...

@xieshengGZ
xieshengGZ requested review from xiubli and removed request for jtlayton February 21, 2023 08:25
@xiubli

xiubli commented Feb 21, 2023

Copy link
Copy Markdown
Member

Please fix the issue mentioned in #44593 (comment).

Sorry, I'm not sure what needs to be fixed. Check whether the cache in the kernel is read-only?

You should get the reference of the pLsAsFs caps before caching the dentries, etc, you need to dig it maybe there need a little more work to do.

@xieshengGZ You still need to fix this. Thanks.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Apr 22, 2023
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants