Project

General

Profile

Actions

Feature #41209

closed

mds: create a configurable snapshot limit

Added by Patrick Donnelly over 4 years ago. Updated almost 4 years ago.

Status:
Resolved
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 3 (0 open3 closed)

Related to CephFS - Feature #21571: mds: limit number of snapshots (global and subtree)DuplicateZheng Yan

Actions
Copied to CephFS - Backport #42440: mimic: mds: create a configurable snapshot limitRejectedMilind ChangireActions
Copied to CephFS - Backport #42441: nautilus: mds: create a configurable snapshot limitResolvedMilind ChangireActions
Actions #1

Updated by Zheng Yan over 4 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.

Actions #2

Updated by Milind Changire over 4 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 ?

Actions #3

Updated by Zheng Yan over 4 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

Actions #4

Updated by Milind Changire over 4 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

Actions #5

Updated by Patrick Donnelly over 4 years ago

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

Updated by Patrick Donnelly over 4 years ago

  • Status changed from New to Pending Backport
Actions #7

Updated by Patrick Donnelly over 4 years ago

  • Pull request ID set to 30710
Actions #8

Updated by Nathan Cutler over 4 years ago

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

Updated by Nathan Cutler over 4 years ago

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

Updated by Nathan Cutler almost 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".

Actions

Also available in: Atom PDF