cephfs: refresh recursive stats before volume stats - #6501
Open
baldugus wants to merge 1 commit into
Open
Conversation
Reading the ceph.dir.rbytes virtual xattr refreshes the kernel CephFS client's cached usage. Do it best-effort before statfs so NodeGetVolumeStats can report current quota usage without failing. Signed-off-by: Gustavo Balduino <gustavo@balduino.com.br>
Author
|
The tests had failed, but I saw that you fixed the ceph-release RPM URL yesterday, so I've rebased my branch onto the latest commits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe what this PR does
Refreshes CephFS recursive statistics before collecting filesystem usage.
Linux CephFS
statfs()overrides filesystem statistics for quota-backed mounts using the quota inode's cachedrbytesvalue (source) instead of using the fresh values like the regularstatfs()path (source).On the other hand, Ceph MDS only broadcasts new statistics when usage changes by approx. 1/16 of the difference between the last reported usage and the max quota available (source).
Slow growing volumes can remain for long periods with stale usage and consequently stale
kubelet_volume_stats_used_bytes. In my cluster I noticed my metrics database had several PVCs reporting the same used bytes for a whole month, despite constant write activity.Neither behavior is wrong on its own, so I wrote this patch intending to make the statistics accurate in ceph-csi.
I've ran the added E2E test on the latest commit at devel (f4ce351) and in this PR and I could reproduce a fail before and a pass after.
I've also replaced my production ceph-csi with this patch and all affected volumes started reporting the current usage.
This is my manual reproduction before the patch on my kubernetes host:
Is there anything that requires special attention
This is my first contribution to ceph-csi. I believe this change is backward compatible.
If this is accepted, is it worth updating the pending release notes? I was unsure about it, so I didn't include an update in this PR.
Related issues
#2579
Future concerns
This adds an MDS request when collecting CephFS volume statistics. If a CephFS-side change makes
statfs()sufficient in the future, this patch could be reconsidered.Checklist:
guidelines in the developer
guide.
Request
notes
updated with breaking and/or notable changes for the next major release.