From 2465df57b7156b00cd9d8f6118aba7b9127f4059 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 25 Jun 2018 13:08:21 -0500 Subject: [PATCH] os/filestore: add _merge_collections post-check Signed-off-by: Sage Weil --- src/os/filestore/FileStore.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 70ccde6e8f7..f7bd3eb3cd0 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; -- 2.39.5