Skip to content

Commit

Permalink
Merge pull request #49440 from neesingh-rh/wip-58250-pacific
Browse files Browse the repository at this point in the history
pacific: mds: avoid ~mdsdir's scrubbing and reporting damage health status

Reviewed-by: Xiubo Li <xiubli@redhat.com>
  • Loading branch information
yuriw committed Mar 14, 2023
2 parents d7cf4c5 + 2f19043 commit 621915f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qa/tasks/cephfs/test_scrub.py
Expand Up @@ -176,3 +176,12 @@ def test_scrub_backtrace(self):

def test_scrub_dup_inode(self):
self._scrub(DupInodeWorkload(self, self.fs, self.mount_a))

def test_mdsdir_scrub_backtrace(self):
damage_count = self._get_damage_count()
self.assertNotIn("MDS_DAMAGE", self.mds_cluster.mon_manager.get_mon_health()['checks'])

out_json = self.fs.run_scrub(["start", "~mdsdir", "recursive"])
self.assertEqual(self.fs.wait_until_scrub_complete(tag=out_json["scrub_tag"]), True)
self.assertEqual(self._get_damage_count(), damage_count)
self.assertNotIn("MDS_DAMAGE", self.mds_cluster.mon_manager.get_mon_health()['checks'])
4 changes: 4 additions & 0 deletions src/mds/CInode.cc
Expand Up @@ -4693,6 +4693,10 @@ void CInode::validate_disk_state(CInode::validated_data *results,
results->backtrace.error_str << "failed to read off disk; see retval";
// we probably have a new unwritten file!
// so skip the backtrace scrub for this entry and say that all's well
if (in->is_mdsdir()){
dout(20) << "forcing backtrace as passed since mdsdir actually doesn't have backtrace" << dendl;
results->backtrace.passed = true;
}
if (in->is_dirty_parent()) {
dout(20) << "forcing backtrace as passed since inode is dirty parent" << dendl;
results->backtrace.passed = true;
Expand Down

0 comments on commit 621915f

Please sign in to comment.