Feature #41209
mds: create a configurable snapshot limit
0%
Description
Add a new config option that imposes a limit on the number of snapshots in a directory. Zheng has found in the past that a directory with too many snapshots will result in performance issues on the MDS. Verify this is still the case. A test case should be prepared that ensures the limit is enforced and that it the limit is applied per-directory (i.e. one directory hitting its limit should not affect another).
Related issues
History
#1 Updated by Zheng Yan over 1 year ago
mds.0 has snaptable, which contains information about all snapshots. Each mds has a snapclient, which also caches snapshot information. From there, you can get total number of snapshot in the FS.
ceph inodes have rstat, rstat.rsnaps is number of nested snapshots under a directory (root inode's rstat.rsnaps also is total number of snapshots in the FS).
To limit snapshot count on a directory, check snapshot count when making new snaps. In Server::handle_client_mksnap, check snapshot count after locks are acquired.
#2 Updated by Milind Changire over 1 year ago
Thanks for the hint Zheng.
How could the MDS return the status "too many snaps" to the caller ?
There's no error code in the system errno.h to denote this condition.
The attempt to create a snapshot beyond the limit for the directory cannot be silently ignored, now that we plan to impose a configurable limit.
Any suggestion for a default limit ?
5 snapshots per directory should be enough ?
#3 Updated by Zheng Yan over 1 year ago
Milind Changire wrote:
Thanks for the hint Zheng.
How could the MDS return the status "too many snaps" to the caller ?
There's no error code in the system errno.h to denote this condition.
how about -E2BIG
The attempt to create a snapshot beyond the limit for the directory cannot be silently ignored, now that we plan to impose a configurable limit.
Any suggestion for a default limit ?
5 snapshots per directory should be enough ?
I suggest 100
#4 Updated by Milind Changire over 1 year ago
Zheng Yan wrote:
Milind Changire wrote:
Thanks for the hint Zheng.
How could the MDS return the status "too many snaps" to the caller ?
There's no error code in the system errno.h to denote this condition.how about -E2BIG
-EMLINK seems reasonable too
The attempt to create a snapshot beyond the limit for the directory cannot be silently ignored, now that we plan to impose a configurable limit.
Any suggestion for a default limit ?
5 snapshots per directory should be enough ?I suggest 100
#5 Updated by Patrick Donnelly over 1 year ago
- Related to Feature #21571: mds: limit number of snapshots (global and subtree) added
#6 Updated by Patrick Donnelly about 1 year ago
- Status changed from New to Pending Backport
#7 Updated by Patrick Donnelly about 1 year ago
- Pull request ID set to 30710
#8 Updated by Nathan Cutler about 1 year ago
- Copied to Backport #42440: mimic: mds: create a configurable snapshot limit added
#9 Updated by Nathan Cutler about 1 year ago
- Copied to Backport #42441: nautilus: mds: create a configurable snapshot limit added
#10 Updated by Nathan Cutler 8 months ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".