Skip to content

Commit

Permalink
Merge pull request ceph#34410 from lxbsz/mds_dirty_parent
Browse files Browse the repository at this point in the history
tools/cephfs: add accounted_rstat/rstat when building file dentry

Reviewed-by: "Yan, Zheng" <[email protected]>
  • Loading branch information
gregsfortytwo authored Apr 17, 2020
2 parents 62dadb2 + 62e9820 commit c17f4d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions qa/tasks/cephfs/test_data_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ def test_fragmented_injection(self):
file_count = 100
file_names = ["%s" % n for n in range(0, file_count)]

# Make sure and disable dirfrag auto merging and splitting
self.fs.set_ceph_conf('mds', 'mds bal merge size', 0)
self.fs.set_ceph_conf('mds', 'mds bal split size', 100 * file_count)

# Create a directory of `file_count` files, each named after its
# decimal number and containing the string of its decimal number
self.mount_a.run_python(dedent("""
Expand Down Expand Up @@ -485,6 +489,7 @@ def test_fragmented_injection(self):
# by checking the omap now has the dentry's key again
self.fs.data_scan(["scan_extents", self.fs.get_data_pool_name()])
self.fs.data_scan(["scan_inodes", self.fs.get_data_pool_name()])
self.fs.data_scan(["scan_links"])
self.assertIn(victim_key, self._dirfrag_keys(frag_obj_id))

# Start the filesystem and check that the dentry we deleted is now once again visible
Expand All @@ -505,6 +510,14 @@ def test_fragmented_injection(self):
keys = self._dirfrag_keys(frag_obj_id)
self.assertListEqual(sorted(keys), sorted(["%s_head" % f for f in file_names]))

# run scrub to update and make sure rstat.rbytes info in subdir inode and dirfrag
# are matched
out_json = self.fs.rank_tell(["scrub", "start", "/subdir", "repair", "recursive"])
self.assertNotEqual(out_json, None)

# Remove the whole 'sudbdir' directory
self.mount_a.run_shell(["rm", "-rf", "subdir/"])

@for_teuthology
def test_parallel_execution(self):
self._rebuild_metadata(ManyFilesWorkload(self.fs, self.mount_a, 25), workers=7)
Expand Down
2 changes: 1 addition & 1 deletion src/mds/MDCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11448,7 +11448,7 @@ void MDCache::merge_dir(CInode *diri, frag_t frag)

CDir *first = dirs.front();
int bits = first->get_frag().bits() - frag.bits();
dout(10) << " we are merginb by " << bits << " bits" << dendl;
dout(10) << " we are merging by " << bits << " bits" << dendl;

dirfrag_t basedirfrag(diri->ino(), frag);
MDRequestRef mdr = request_start_internal(CEPH_MDS_OP_FRAGMENTDIR);
Expand Down

0 comments on commit c17f4d9

Please sign in to comment.