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: v18.1.0~1039^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1a675dd2a3a7bb39cc4aef8fe4032c9fe6b88633;p=ceph.git cephfs-data-scan: make scan_links more verbose Fixes: https://tracker.ceph.com/issues/57589 Signed-off-by: Mykola Golub --- diff --git a/src/tools/cephfs/DataScan.cc b/src/tools/cephfs/DataScan.cc index 58b6fadf493..5849f7141b4 100644 --- a/src/tools/cephfs/DataScan.cc +++ b/src/tools/cephfs/DataScan.cc @@ -951,6 +951,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); @@ -1121,7 +1123,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) { @@ -1183,9 +1191,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; @@ -1194,7 +1207,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); @@ -1214,7 +1232,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); @@ -1234,6 +1257,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); @@ -1252,6 +1277,8 @@ int DataScan::scan_links() } } + dout(10) << "updating snaptable" << dendl; + { SnapServer snaptable; snaptable.set_rank(0);