Skip to content

mds: account for snapshot items when deciding to split or merge a directory - #48907

Merged
vshankar merged 2 commits into
ceph:mainfrom
vshankar:wip-cdir-merge-snap-items
Dec 22, 2022
Merged

vshankar merged 2 commits into
ceph:mainfrom
vshankar:wip-cdir-merge-snap-items

Conversation

@vshankar

Copy link
Copy Markdown
Contributor

Its easy to "overload" a directory object with large number of omap entries by
doing the following (one shot or over and over again):

  - touch dir/file{0..11000} ; create 11000 files (> mds_bal_split_size)
  - mkdir dir/.snap/snap_a
  - rm -f dir/file{0..11000}

End result - the directory object would have 11000 omap entries since the MDS
does not fragment directory snapshots. If the number of such entries exceed
osd_deep_scrub_large_omap_object_key_threshold (default: 200000), a cluster
health warning is generated:

   Large Omap objects found in pool...

--

So, this change might crash and burn the MDS. We'll have to test it and see what breaks. The number of snap/null items in a directory fragment is not used extensively in CDir source (except for deciding some fast path while splitting).

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@github-actions github-actions Bot added cephfs Ceph File System tests labels Nov 16, 2022
@vshankar
vshankar force-pushed the wip-cdir-merge-snap-items branch 2 times, most recently from 049b058 to 6e43ae6 Compare November 16, 2022 10:54
@vshankar
vshankar requested a review from a team November 16, 2022 13:30
Comment thread src/mds/CDir.cc Resolved
@vshankar vshankar changed the title [RFC]: mds: account for snapshot items when deciding to split or merge a directory mds: account for snapshot items when deciding to split or merge a directory Dec 22, 2022

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…ectory

Its easy to "overload" a directory object with large number of omap entries by
doing the following (one shot or over and over again):

      - touch dir/file{0..11000} ; create 11000 files (> mds_bal_split_size)
      - mkdir dir/.snap/snap_a
      - rm -f dir/file{0..11000}

End result - the directory object would have 11000 omap entries since the MDS
does not fragment directory snapshots. If the number of such entries exceed
`osd_deep_scrub_large_omap_object_key_threshold` (default: 200000), a cluster
health warning is generated:

       Large Omap objects found in pool...

CDir::should_merge() does not take into account COW'd inodes and the frags
get merged.

Fixes: http://tracker.ceph.com/issues/55215
Signed-off-by: Venky Shankar <[email protected]>
@vshankar
vshankar force-pushed the wip-cdir-merge-snap-items branch from 6e43ae6 to 7547990 Compare December 22, 2022 14:32
@vshankar

Copy link
Copy Markdown
Contributor Author

(commit message update with tracker ticket)

@vshankar
vshankar merged commit 337de6b into ceph:main Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants