Skip to content

client: try to invalidate the dcache when any shared caps lost - #44432

Closed
xiubli wants to merge 1 commit into
ceph:mainfrom
xiubli:client_inval_dcache
Closed

xiubli wants to merge 1 commit into
ceph:mainfrom
xiubli:client_inval_dcache

Conversation

@xiubli

@xiubli xiubli commented Dec 31, 2021 •

Copy link
Copy Markdown
Member

We don't know what has happened when the MDS is revoking the shared
caps, maybe deleting the files, etc. We need to invalidate the dcaches
for the dentries linked to that inode to force to lookup it from the backend
in future.

Signed-off-by: Xiubo Li [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

@github-actions github-actions Bot added the cephfs Ceph File System label Dec 31, 2021
@xiubli
xiubli requested review from a team and jtlayton December 31, 2021 08:18
@xiubli
xiubli force-pushed the client_inval_dcache branch from 20d7b3f to 19c469a Compare December 31, 2021 09:50
@xiubli

xiubli commented Jan 4, 2022

Copy link
Copy Markdown
Member Author

jenkins retest this please

@xiubli

xiubli commented Jan 5, 2022

Copy link
Copy Markdown
Member Author

jenkins test make check

Comment thread src/client/Client.cc 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.

These changes do not look related to client: try to invalidate the dcache when any shared caps lost. Can you explain? Perhaps in another commit?

Also, do you have a reproducer for the problem or is this something you believe exists but can't reproduce?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These changes do not look related to client: try to invalidate the dcache when any shared caps lost. Can you explain? Perhaps in another commit?

I intend to invalidate the dentry cache only, in such as kernel fuse or third part app, like the Ganesha's NFS, when any shared caps gets lost. To make sure that the kernel fuse or Ganesha's NFS to ignore the relevant dentry caches.

There has two cases will trigger this in handle_cap_grant(), the first one is when nlink == 0 and another is when any shared caps gets lost.

Also, do you have a reproducer for the problem or is this something you believe exists but can't reproduce?

I didn't have the Ganesha NFS setups, so tried to use the ceph-fuse by hard coding to enable the entry_timeout options for the lookup today. The test case is :

mounter-cephfs-A:   'touch /mnt/cephfs-A/file0; ll /mnt/cephfs-A/'
mounter-cpehfs-B:   'ln /mnt/cephfs-B/file0 /mnt/cephfs-B/file1; rm /mnt/cephfs-B/file0 -f'
mounter-cephfs-A:   'll /cephfs/file0'

Without this PR, in the last step in mounter-cephfs-A we can still see the file0.

More detail please see: https://tracker.ceph.com/issues/53730#note-5

IMO, this should be enough to help Sheng Xie to push the above tracker to add the entry_timeout and attr_timeout support, which really could improve the perf much.

Comment thread src/client/Client.cc 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.

I'm not sure this condition works to preserve prior behavior — if there are hard links, we might have dropped our last reference to the inode without it ending up at nlink==0.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Before only when in->nlink == 0 will the deleted_inode be set. The code:

5455     if (in->nlink == 0)
5456       deleted_inode = true; 

And currently I added another case when CEPH_STAT_CAP_INODE_ALL caps are being revoked will the deleted_inode to be set too.

Yeah, I will push another version to make the code more readable.

@xiubli
xiubli force-pushed the client_inval_dcache branch from 47318e6 to 84e1c58 Compare February 8, 2022 12:23
@gregsfortytwo

Copy link
Copy Markdown
Member

This version looks better to me 👍

@djgalloway
djgalloway changed the base branch from master to main June 1, 2022 16:52
@github-actions

github-actions Bot commented Aug 5, 2022

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 Aug 5, 2022
@vshankar vshankar removed the stale label Aug 25, 2022
@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 Dec 29, 2022
@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 Jan 28, 2023
@xiubli xiubli reopened this Jan 31, 2023
@github-actions github-actions Bot removed the stale label Jan 31, 2023

@rishabh-d-dave rishabh-d-dave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks okay to me.

@rishabh-d-dave rishabh-d-dave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks okay to me.

(Forgot to approve last time)

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

jenkins test make check

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

jenkins test api

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

jenkins test docs

@rishabh-d-dave

Copy link
Copy Markdown
Contributor

@lxbsz Should this PR be put through QA?

@xiubli

xiubli commented Feb 8, 2023

Copy link
Copy Markdown
Member Author

@lxbsz Should this PR be put through QA?

Yeah, please. Thanks.

We don't know what has happened when the MDS is revoking the shared
caps, maybe deleting the files, etc. We need to invalidate the dcaches
for the dentries linked to that inode to force to lookup it from the
backend in future.

Signed-off-by: Xiubo Li <[email protected]>
@xiubli
xiubli force-pushed the client_inval_dcache branch from 84e1c58 to 6535938 Compare February 8, 2023 01:46
@xiubli

xiubli commented Feb 8, 2023

Copy link
Copy Markdown
Member Author

Just rebased it and nothing changed.

@github-actions

github-actions Bot commented Apr 9, 2023

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 9, 2023
@xiubli xiubli removed the stale label Apr 10, 2023
@github-actions

github-actions Bot commented Jun 9, 2023

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 Jun 9, 2023
@github-actions

github-actions Bot commented Jul 9, 2023

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 Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants