Enhancement #79581
closedclient: cache negatives for inodes on MDS reply
0%
Description
This came up when I was studying cephfs-mirror behaviour when a non-existent dir is added for mirroring. A few calls down the stream, cephfs-mirror does a polling in a thread (via sync_perms()) for the non-existent dirs but the API used --libcephfs's ceph_statx() would call Client::_getattr() every time which would send a MDS request. Meaning there is no caching here but the kclient does cache stat() negatives and I think ceph-fuse can do it too. We already do cache negatives but just not for stat APIs so let's start doing that to optimize MDS round trips. This might hit positives in case there's a cache churn, it is quite possible the negatives might hijack the client cache due to a stat() storm. Probably bound this growth based on some formula (like max_cache / N) or adding a time decay may help? Thoughts welcome.
DP Updated by Dhairya Parmar 4 months ago
- Assignee set to Dhairya Parmar
- Pull request ID set to 71141
DP Updated by Dhairya Parmar 4 months ago
- Description updated (diff)
VS Updated by Venky Shankar 3 months ago
- Subject changed from [RFC] client: cache negatives for ceph_statx() calls to client: cache negatives for inodes on MDS reply
- Status changed from New to Fix Under Review
- Target version set to v22.0.0
- Backport set to umbrella,tentacle,squid
UB Updated by Upkeep Bot 3 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to e186e0ccb86177680fba5f1b128a11bda7d25262
- Fixed In set to v21.3.0-3029-ge186e0ccb8
- Upkeep Timestamp set to 2026-09-08T05:42:25+00:00
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80375: umbrella: client: cache negatives for inodes on MDS reply added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80376: squid: client: cache negatives for inodes on MDS reply added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80377: tentacle: client: cache negatives for inodes on MDS reply added
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Upkeep Timestamp changed from 2026-09-08T05:42:25+00:00 to 2026-09-08T12:29:05+00:00