From: Patrick Donnelly Date: Tue, 12 Sep 2017 21:29:49 +0000 (-0700) Subject: mds: go back to compact_map for replicas X-Git-Tag: v13.0.1~926^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5d67b5cc57ac803e60c2921f554cd0507ed4848e;p=ceph.git mds: go back to compact_map for replicas Zheng observed that an alloc_ptr doesn't really work in this case since any call to get_replicas() will cause the map to be allocated, nullifying the benefit. Use a compact_map until a better solution can be written. (This means that the map will be allocated outside the mempool.) Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/MDSCacheObject.h b/src/mds/MDSCacheObject.h index 845a4a92f032..96493d4dd8cf 100644 --- a/src/mds/MDSCacheObject.h +++ b/src/mds/MDSCacheObject.h @@ -253,8 +253,8 @@ protected: // replication (across mds cluster) protected: unsigned replica_nonce; // [replica] defined on replica - typedef mempool::mds_co::map replica_map_type; - alloc_ptr replica_map; // [auth] mds -> nonce + typedef compact_map replica_map_type; + replica_map_type replica_map; // [auth] mds -> nonce public: bool is_replicated() const { return !get_replicas().empty(); } @@ -281,16 +281,14 @@ protected: get_replicas().erase(mds); if (get_replicas().empty()) { put(PIN_REPLICATED); - replica_map.reset(); } } void clear_replica_map() { if (!get_replicas().empty()) put(PIN_REPLICATED); - replica_map.reset(); } - replica_map_type& get_replicas() { return *replica_map; } - const replica_map_type& get_replicas() const { return *replica_map; } + replica_map_type& get_replicas() { return replica_map; } + const replica_map_type& get_replicas() const { return replica_map; } void list_replicas(std::set& ls) const { for (const auto &p : get_replicas()) { ls.insert(p.first);