From: Mykola Golub Date: Sun, 18 Sep 2022 14:33:25 +0000 (+0100) Subject: cephfs-data-scan: make scan_links more verbose X-Git-Tag: v16.2.11~79^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a93195ab65bd58d7be78c7b442d7da9bfa2a70f;p=ceph.git cephfs-data-scan: make scan_links more verbose Fixes: https://tracker.ceph.com/issues/57589 Signed-off-by: Mykola Golub (cherry picked from commit 1a675dd2a3a7bb39cc4aef8fe4032c9fe6b88633) --- diff --git a/src/tools/cephfs/DataScan.cc b/src/tools/cephfs/DataScan.cc index 649e96b15ad3..9f942964dd27 100644 --- a/src/tools/cephfs/DataScan.cc +++ b/src/tools/cephfs/DataScan.cc @@ -948,6 +948,8 @@ int DataScan::scan_links() for (auto it = metadata_io.nobjects_begin(); it != it_end; ++it) { const std::string oid = it->get_oid(); + dout(10) << "step " << step << ": handling object " << oid << dendl; + uint64_t dir_ino = 0; uint64_t frag_id = 0; int r = parse_oid(oid, &dir_ino, &frag_id); @@ -1116,7 +1118,13 @@ int DataScan::scan_links() used_inos.clear(); + dout(10) << "processing " << dup_primaries.size() << " dup_primaries, " + << remote_links.size() << " remote_links" << dendl; + for (auto& p : dup_primaries) { + + dout(10) << "handling dup " << p.first << dendl; + link_info_t newest; for (auto& q : p.second) { if (q.version > newest.version) { @@ -1178,9 +1186,14 @@ int DataScan::scan_links() } } + dout(10) << "removing dup dentries from " << to_remove.size() << " objects" + << dendl; + for (auto& p : to_remove) { object_t frag_oid = InodeStore::get_object_name(p.first.ino, p.first.frag, ""); + dout(10) << "removing dup dentries from " << p.first << dendl; + int r = metadata_io.omap_rm_keys(frag_oid.name, p.second); if (r != 0) { derr << "Error removing duplicated dentries from " << p.first << dendl; @@ -1189,7 +1202,12 @@ int DataScan::scan_links() } to_remove.clear(); + dout(10) << "processing " << bad_nlink_inos.size() << " bad_nlink_inos" + << dendl; + for (auto &p : bad_nlink_inos) { + dout(10) << "handling bad_nlink_ino " << p.first << dendl; + InodeStore inode; snapid_t first; int r = read_dentry(p.second.dirino, p.second.frag, p.second.name, &inode, &first); @@ -1209,7 +1227,12 @@ int DataScan::scan_links() return r; } + dout(10) << "processing " << injected_inos.size() << " injected_inos" + << dendl; + for (auto &p : injected_inos) { + dout(10) << "handling injected_ino " << p.first << dendl; + InodeStore inode; snapid_t first; int r = read_dentry(p.second.dirino, p.second.frag, p.second.name, &inode, &first); @@ -1229,6 +1252,8 @@ int DataScan::scan_links() return r; } + dout(10) << "updating inotable" << dendl; + for (auto& p : max_ino_map) { InoTable inotable(nullptr); inotable.set_rank(p.first); @@ -1247,6 +1272,8 @@ int DataScan::scan_links() } } + dout(10) << "updating snaptable" << dendl; + { SnapServer snaptable; snaptable.set_rank(0);