From: Sage Weil Date: Mon, 25 Jun 2018 18:08:21 +0000 (-0500) Subject: os/filestore: add _merge_collections post-check X-Git-Tag: v14.0.1~371^2~65 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2465df57b7156b00cd9d8f6118aba7b9127f4059;p=ceph.git os/filestore: add _merge_collections post-check Signed-off-by: Sage Weil --- diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 70ccde6e8f7b..f7bd3eb3cd0f 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -5784,6 +5784,31 @@ int FileStore::_merge_collection(const coll_t& cid, if (_check_replay_guard(cid, spos) > 0) r = _destroy_collection(cid); + if (!r && cct->_conf->filestore_debug_verify_split) { + vector objects; + ghobject_t next; + while (1) { + collection_list( + dest, + next, ghobject_t::get_max(), + get_ideal_list_max(), + &objects, + &next); + if (objects.empty()) + break; + for (vector::iterator i = objects.begin(); + i != objects.end(); + ++i) { + if (!i->match(bits, pgid.pgid.ps())) { + dout(20) << __FUNC__ << ": " << *i << " does not belong in " + << cid << dendl; + assert(i->match(bits, pgid.pgid.ps())); + } + } + objects.clear(); + } + } + dout(15) << __FUNC__ << ": " << cid << " " << dest << " bits " << bits << " = " << r << dendl; return r;