From: Varsha Rao Date: Mon, 18 Nov 2019 16:07:41 +0000 (+0530) Subject: mds: Reorganize class members in Server header X-Git-Tag: v15.1.0~126^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e071c0f134969b6dd64c19ab86483c84288fa89;p=ceph.git mds: Reorganize class members in Server header Fixes: https://tracker.ceph.com/issues/42867 Signed-off-by: Varsha Rao --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 60401669812..598d09c07f8 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -225,12 +225,6 @@ void Server::create_logger() Server::Server(MDSRank *m) : mds(m), mdcache(mds->mdcache), mdlog(mds->mdlog), - logger(0), - is_full(false), - reconnect_done(NULL), - failed_reconnects(0), - reconnect_evicting(false), - terminating_sessions(false), recall_throttle(g_conf().get_val("mds_recall_max_decay_rate")) { replay_unsafe_with_closed_session = g_conf().get_val("mds_replay_unsafe_with_closed_session"); diff --git a/src/mds/Server.h b/src/mds/Server.h index a262ee125e2..aa64e86be76 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -84,39 +84,13 @@ public: using clock = ceph::coarse_mono_clock; using time = ceph::coarse_mono_time; -private: - MDSRank *mds; - MDCache *mdcache; - MDLog *mdlog; - PerfCounters *logger; - - // OSDMap full status, used to generate ENOSPC on some operations - bool is_full; - - // State for while in reconnect - MDSContext *reconnect_done; - int failed_reconnects; - bool reconnect_evicting; // true if I am waiting for evictions to complete - // before proceeding to reconnect_gather_finish - time reconnect_start = clock::zero(); - time reconnect_last_seen = clock::zero(); - set client_reconnect_gather; // clients i need a reconnect msg from. - - feature_bitset_t supported_features; - feature_bitset_t required_client_features; - - bool replay_unsafe_with_closed_session = false; - double cap_revoke_eviction_timeout = 0; - uint64_t max_snaps_per_dir = 100; - - friend class MDSContinuation; - friend class ServerContext; - friend class ServerLogContext; - friend class Batch_Getattr_Lookup; - -public: - bool terminating_sessions; - + enum class RecallFlags : uint64_t { + NONE = 0, + STEADY = (1<<0), + ENFORCE_MAX = (1<<1), + TRIM = (1<<2), + ENFORCE_LIVENESS = (1<<3), + }; explicit Server(MDSRank *m); ~Server() { g_ceph_context->get_perfcounters_collection()->remove(logger); @@ -155,7 +129,6 @@ public: size_t apply_blacklist(const std::set &blacklist); void journal_close_session(Session *session, int state, Context *on_safe); - set client_reclaim_gather; size_t get_num_pending_reclaim() const { return client_reclaim_gather.size(); } Session *find_session_by_uuid(std::string_view uuid); void reclaim_session(Session *session, const cref_t &m); @@ -172,13 +145,6 @@ public: void reconnect_tick(); void recover_filelocks(CInode *in, bufferlist locks, int64_t client); - enum class RecallFlags : uint64_t { - NONE = 0, - STEADY = (1<<0), - ENFORCE_MAX = (1<<1), - TRIM = (1<<2), - ENFORCE_LIVENESS = (1<<3), - }; std::pair recall_client_state(MDSGatherBuilder* gather, RecallFlags=RecallFlags::NONE); void force_clients_readonly(); @@ -226,7 +192,6 @@ public: CDir* try_open_auth_dirfrag(CInode *diri, frag_t fg, MDRequestRef& mdr); - // requests on existing inodes. void handle_client_getattr(MDRequestRef& mdr, bool is_lookup); void handle_client_lookup_ino(MDRequestRef& mdr, @@ -318,7 +283,6 @@ public: void handle_client_renamesnap(MDRequestRef& mdr); void _renamesnap_finish(MDRequestRef& mdr, CInode *diri, snapid_t snapid); - // helpers bool _rename_prepare_witness(MDRequestRef& mdr, mds_rank_t who, set &witnesse, vector& srctrace, vector& dsttrace, CDentry *straydn); @@ -347,11 +311,44 @@ public: void evict_cap_revoke_non_responders(); void handle_conf_change(const std::set& changed); + bool terminating_sessions = false; + + set client_reclaim_gather; + private: + friend class MDSContinuation; + friend class ServerContext; + friend class ServerLogContext; + friend class Batch_Getattr_Lookup; + void reply_client_request(MDRequestRef& mdr, const ref_t &reply); void flush_session(Session *session, MDSGatherBuilder *gather); void clear_batch_ops(const MDRequestRef& mdr); + MDSRank *mds; + MDCache *mdcache; + MDLog *mdlog; + PerfCounters *logger = nullptr; + + // OSDMap full status, used to generate ENOSPC on some operations + bool is_full = false; + + // State for while in reconnect + MDSContext *reconnect_done = nullptr; + int failed_reconnects = 0; + bool reconnect_evicting = false; // true if I am waiting for evictions to complete + // before proceeding to reconnect_gather_finish + time reconnect_start = clock::zero(); + time reconnect_last_seen = clock::zero(); + set client_reconnect_gather; // clients i need a reconnect msg from. + + feature_bitset_t supported_features; + feature_bitset_t required_client_features; + + bool replay_unsafe_with_closed_session = false; + double cap_revoke_eviction_timeout = 0; + uint64_t max_snaps_per_dir = 100; + DecayCounter recall_throttle; time last_recall_state; }; @@ -372,5 +369,4 @@ static inline constexpr bool operator!(const Server::RecallFlags& f) { using T = std::underlying_type::type; return static_cast(f) == static_cast(0); } - #endif