From: Sage Weil Date: Mon, 29 Jul 2019 19:44:15 +0000 (-0500) Subject: os/bluestore: teach fsck to tolerate per-pool omap X-Git-Tag: v15.1.0~1915^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b2119ffb501b81b618ee7eb851b95963d4528847;p=ceph-ci.git os/bluestore: teach fsck to tolerate per-pool omap Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index a0ac33fad2e..4ce2d378189 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7021,6 +7021,7 @@ int BlueStore::_fsck(bool deep, bool repair) mempool::bluestore_fsck::pool_allocator> uint64_t_btree_t; uint64_t_btree_t used_nids; uint64_t_btree_t used_omap_head; + uint64_t_btree_t used_per_pool_omap_head; uint64_t_btree_t used_pgmeta_omap_head; uint64_t_btree_t used_sbids; @@ -7483,7 +7484,8 @@ int BlueStore::_fsck(bool deep, bool repair) // omap if (o->onode.has_omap()) { auto& m = - o->onode.is_pgmeta_omap() ? used_pgmeta_omap_head : used_omap_head; + o->onode.is_pgmeta_omap() ? used_pgmeta_omap_head : + (o->onode.is_perpool_omap() ? used_per_pool_omap_head : used_omap_head); if (m.count(o->onode.nid)) { derr << "fsck error: " << oid << " omap_head " << o->onode.nid << " already in use" << dendl; @@ -7832,7 +7834,23 @@ int BlueStore::_fsck(bool deep, bool repair) uint64_t omap_head; _key_decode_u64(it->key().c_str(), &omap_head); if (used_pgmeta_omap_head.count(omap_head) == 0) { - derr << "fsck error: found stray omap data on omap_head " + derr << "fsck error: found stray (pgmeta) omap data on omap_head " + << omap_head << dendl; + ++errors; + } + } + } + it = db->get_iterator(PREFIX_PERPOOL_OMAP); + if (it) { + for (it->lower_bound(string()); it->valid(); it->next()) { + uint64_t pool; + uint64_t omap_head; + string k = it->key(); + char *c = k.c_str(); + c = _key_decode_u64(c, &pool); + c = _key_decode_u64(c, &omap_head); + if (used_per_pool_omap_head.count(omap_head) == 0) { + derr << "fsck error: found stray (per-pool) omap data on omap_head " << omap_head << dendl; ++errors; }