Skip to content

Commit

Permalink
qa: add missing scan_links step for data scan recovery
Browse files Browse the repository at this point in the history
Without, the first field remains corrupt (HEAD).

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
  • Loading branch information
batrick committed Mar 28, 2023
1 parent 219a7b7 commit 686b4b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions qa/tasks/cephfs/test_data_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def get_state(mds_id):
self.fs.data_scan(["init"])
self.fs.data_scan(["scan_extents"], worker_count=workers)
self.fs.data_scan(["scan_inodes"], worker_count=workers)
self.fs.data_scan(["scan_links"])

# Mark the MDS repaired
self.fs.mon_manager.raw_cluster_cmd('mds', 'repaired', '0')
Expand Down
13 changes: 10 additions & 3 deletions qa/tasks/cephfs/test_forward_scrub.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_orphan_scan(self):
# 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
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_orphan_scan(self):

# 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'])
Expand All @@ -175,14 +175,21 @@ def test_orphan_scan(self):
# 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)
Expand Down

0 comments on commit 686b4b3

Please sign in to comment.