Feature #41209
closedmds: 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).
Updated by Zheng Yan almost 5 years 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.
Updated by Milind Changire almost 5 years 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 ?
Updated by Zheng Yan almost 5 years 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
Updated by Milind Changire almost 5 years 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
Updated by Patrick Donnelly over 4 years ago
- Related to Feature #21571: mds: limit number of snapshots (global and subtree) added
Updated by Patrick Donnelly over 4 years ago
- Status changed from New to Pending Backport
Updated by Nathan Cutler over 4 years ago
- Copied to Backport #42440: mimic: mds: create a configurable snapshot limit added
Updated by Nathan Cutler over 4 years ago
- Copied to Backport #42441: nautilus: mds: create a configurable snapshot limit added
Updated by Nathan Cutler about 4 years 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".