mds: account for snapshot items when deciding to split or merge a directory
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 <vshankar@redhat.com>
(cherry picked from commit
47cdb3eff519b9ea69c51a2fbc86c20da155f439)