Project

General

Profile

Feature #41209

mds: create a configurable snapshot limit

Added by Patrick Donnelly 4 months ago. Updated about 2 months ago.

Status:
Pending Backport
Priority:
High
Category:
Correctness/Safety
Target version:
% Done:

0%

Source:
Tags:
Backport:
nautilus,mimic
Reviewed:
Affected Versions:
Component(FS):
MDS, qa-suite
Labels (FS):
Pull request ID:

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

Related to fs - Feature #21571: mds: limit number of snapshots (global and subtree) Need More Info
Copied to fs - Backport #42440: mimic: mds: create a configurable snapshot limit Need More Info
Copied to fs - Backport #42441: nautilus: mds: create a configurable snapshot limit Need More Info

History

#1 Updated by Zheng Yan 4 months 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 4 months 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 4 months 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 4 months 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 about 2 months ago

  • Related to Feature #21571: mds: limit number of snapshots (global and subtree) added

#6 Updated by Patrick Donnelly about 2 months ago

  • Status changed from New to Pending Backport

#7 Updated by Patrick Donnelly about 2 months ago

  • Pull request ID set to 30710

#8 Updated by Nathan Cutler about 2 months ago

  • Copied to Backport #42440: mimic: mds: create a configurable snapshot limit added

#9 Updated by Nathan Cutler about 2 months ago

  • Copied to Backport #42441: nautilus: mds: create a configurable snapshot limit added

Also available in: Atom PDF