diff options
author | Sage Weil <sage@inktank.com> | 2012-08-27 19:57:48 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-09-18 14:38:59 -0700 |
commit | e9f051ef3c49a080b24d7811a16aefb64beacbbd (patch) | |
tree | 30fe477ee6ef111ddd79b7f1f9de3a8569ee6ccb /src/osd/OSDMap.h | |
parent | b64641c3ddbd7ce23a09911fbfcc98de2bea674e (diff) | |
download | ceph-e9f051ef3c49a080b24d7811a16aefb64beacbbd.tar.gz |
osdmap: include osd_xinfo_t to track laggy probabilities, timestamps
Track information about laggy probabilities for each OSD. That is, the
probability that if it is marked down it is because it is laggy, and
the expected interval over which it will take to recovery if it is laggy.
We store this in the OSDMap because it is not convenient to keep it
elsewhere in the monitor. Yet. When the new mon infrastructure is in
place, there is a bunch of stuff that can be moved out of the OSDMap
'extended' section into other mon data structures.
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/osd/OSDMap.h')
-rw-r--r-- | src/osd/OSDMap.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index edb94261c48..6fdb89d5183 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -87,6 +87,23 @@ WRITE_CLASS_ENCODER(osd_info_t) ostream& operator<<(ostream& out, const osd_info_t& info); +struct osd_xinfo_t { + utime_t down_stamp; ///< timestamp when we were last marked down + __u32 laggy_probability; ///< 0 = definitely not laggy, 0xffffffff definitely laggy + __u32 laggy_interval; ///< average interval between being marked laggy and recovering + + osd_xinfo_t() : laggy_probability(0), laggy_interval(0) {} + + void dump(Formatter *f) const; + void encode(bufferlist& bl) const; + void decode(bufferlist::iterator& bl); + static void generate_test_instances(list<osd_xinfo_t*>& o); +}; +WRITE_CLASS_ENCODER(osd_xinfo_t) + +ostream& operator<<(ostream& out, const osd_xinfo_t& xi); + + /** OSDMap */ class OSDMap { @@ -118,6 +135,7 @@ public: map<int32_t,pair<epoch_t,epoch_t> > new_last_clean_interval; map<int32_t,epoch_t> new_lost; map<int32_t,uuid_d> new_uuid; + map<int32_t,osd_xinfo_t> new_xinfo; map<entity_addr_t,utime_t> new_blacklist; vector<entity_addr_t> old_blacklist; @@ -177,6 +195,7 @@ private: map<string,int64_t> name_pool; std::tr1::shared_ptr< vector<uuid_d> > osd_uuid; + vector<osd_xinfo_t> osd_xinfo; hash_map<entity_addr_t,utime_t> blacklist; @@ -356,6 +375,11 @@ private: assert(osd < max_osd); return osd_info[osd]; } + + const osd_xinfo_t& get_xinfo(int osd) const { + assert(osd < max_osd); + return osd_xinfo[osd]; + } int get_any_up_osd() const { for (int i=0; i<max_osd; i++) |