Skip to content

Commit 1b4d907

Browse files
committed
qa: add missing scan_links step for data scan recovery
Without, the first field remains corrupt (HEAD). Signed-off-by: Patrick Donnelly <[email protected]>
1 parent 293b90f commit 1b4d907

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

qa/tasks/cephfs/test_data_scan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ def get_state(mds_id):
402402
self.fs.data_scan(["init"])
403403
self.fs.data_scan(["scan_extents"], worker_count=workers)
404404
self.fs.data_scan(["scan_inodes"], worker_count=workers)
405+
self.fs.data_scan(["scan_links"])
405406

406407
# Mark the MDS repaired
407408
self.fs.mon_manager.raw_cluster_cmd('mds', 'repaired', '0')

qa/tasks/cephfs/test_forward_scrub.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_orphan_scan(self):
129129
# Umount before flush to avoid cap releases putting
130130
# things we don't want in the journal later.
131131
self.mount_a.umount_wait()
132-
self.fs.mds_asok(["flush", "journal"])
132+
self.fs.flush()
133133

134134
# Create a new inode that's just in the log, i.e. would
135135
# look orphaned to backward scan if backward scan wisnae
@@ -163,7 +163,7 @@ def test_orphan_scan(self):
163163

164164
# Run a tagging forward scrub
165165
tag = "mytag123"
166-
self.fs.mds_asok(["tag", "path", "/parent", tag])
166+
self.fs.rank_asok(["tag", "path", "/parent", tag])
167167

168168
# See that the orphan wisnae tagged
169169
self.assertUntagged(inos['./parent/flushed/bravo'])
@@ -175,14 +175,21 @@ def test_orphan_scan(self):
175175
# See that journalled-but-not-flushed file *was* tagged
176176
self.assertTagged(inos['./parent/unflushed/jfile'], tag, self.fs.get_data_pool_name())
177177

178-
# Run cephfs-data-scan targeting only orphans
178+
# okay, now we are going to run cephfs-data-scan. It's necessary to
179+
# have a clean journal otherwise replay will blowup on mismatched
180+
# inotable versions (due to scan_links)
181+
self.fs.flush()
179182
self.fs.fail()
183+
self.fs.journal_tool(["journal", "reset", "--force"], 0)
184+
185+
# Run cephfs-data-scan targeting only orphans
180186
self.fs.data_scan(["scan_extents", self.fs.get_data_pool_name()])
181187
self.fs.data_scan([
182188
"scan_inodes",
183189
"--filter-tag", tag,
184190
self.fs.get_data_pool_name()
185191
])
192+
self.fs.data_scan(["scan_links"])
186193

187194
# After in-place injection stats should be kosher again
188195
self.fs.set_ceph_conf('mds', 'mds verify scatter', True)

0 commit comments

Comments
 (0)