From 96dee575032384e23ad5138307e341d5e5332e0b Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 24 Mar 2023 17:54:35 -0400 Subject: [PATCH] qa: add missing scan_links step for data scan recovery Without, the first field remains corrupt (HEAD). Signed-off-by: Patrick Donnelly (cherry picked from commit 1b4d9077af826d1931b91938fd49e7113e8d3840) Conflicts: qa/tasks/cephfs/test_data_scan.py --- qa/tasks/cephfs/test_data_scan.py | 1 + qa/tasks/cephfs/test_forward_scrub.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/test_data_scan.py b/qa/tasks/cephfs/test_data_scan.py index dcb7eda40a56d..9e248dc3989ed 100644 --- a/qa/tasks/cephfs/test_data_scan.py +++ b/qa/tasks/cephfs/test_data_scan.py @@ -368,6 +368,7 @@ class TestDataScan(CephFSTestCase): self.fs.data_scan(["init"]) self.fs.data_scan(["scan_extents", self.fs.get_data_pool_name()], worker_count=workers) self.fs.data_scan(["scan_inodes", self.fs.get_data_pool_name()], worker_count=workers) + self.fs.data_scan(["scan_links"]) # Mark the MDS repaired self.fs.mon_manager.raw_cluster_cmd('mds', 'repaired', '0') diff --git a/qa/tasks/cephfs/test_forward_scrub.py b/qa/tasks/cephfs/test_forward_scrub.py index 82630e069587b..29496dc50ac30 100644 --- a/qa/tasks/cephfs/test_forward_scrub.py +++ b/qa/tasks/cephfs/test_forward_scrub.py @@ -129,7 +129,7 @@ class TestForwardScrub(CephFSTestCase): # Umount before flush to avoid cap releases putting # things we don't want in the journal later. self.mount_a.umount_wait() - self.fs.mds_asok(["flush", "journal"]) + self.fs.flush() # Create a new inode that's just in the log, i.e. would # look orphaned to backward scan if backward scan wisnae @@ -163,7 +163,7 @@ class TestForwardScrub(CephFSTestCase): # Run a tagging forward scrub tag = "mytag123" - self.fs.mds_asok(["tag", "path", "/parent", tag]) + self.fs.rank_asok(["tag", "path", "/parent", tag]) # See that the orphan wisnae tagged self.assertUntagged(inos['./parent/flushed/bravo']) @@ -175,14 +175,21 @@ class TestForwardScrub(CephFSTestCase): # See that journalled-but-not-flushed file *was* tagged self.assertTagged(inos['./parent/unflushed/jfile'], tag, self.fs.get_data_pool_name()) - # Run cephfs-data-scan targeting only orphans + # okay, now we are going to run cephfs-data-scan. It's necessary to + # have a clean journal otherwise replay will blowup on mismatched + # inotable versions (due to scan_links) + self.fs.flush() self.fs.fail() + self.fs.journal_tool(["journal", "reset", "--force"], 0) + + # Run cephfs-data-scan targeting only orphans self.fs.data_scan(["scan_extents", self.fs.get_data_pool_name()]) self.fs.data_scan([ "scan_inodes", "--filter-tag", tag, self.fs.get_data_pool_name() ]) + self.fs.data_scan(["scan_links"]) # After in-place injection stats should be kosher again self.fs.set_ceph_conf('mds', 'mds verify scatter', True) -- 2.39.5