int32_t discover;
compact_set<int32_t> dir_rep_by;
filepath path;
+ int tried_discover;
public:
mds_rank_t get_source_mds() const { return from_mds; }
dirfrag_t get_dirfrag() const { return dirfrag; }
int get_dir_rep() const { return dir_rep; }
const compact_set<int>& get_dir_rep_by() const { return dir_rep_by; }
- bool should_discover() const { return discover > 0; }
+ bool should_discover() const { return discover > tried_discover; }
const filepath& get_path() const { return path; }
- void tried_discover() {
- if (discover) discover--;
- }
+ bool has_tried_discover() const { return tried_discover > 0; }
+ void inc_tried_discover() { ++tried_discover; }
- MDirUpdate() : Message(MSG_MDS_DIRUPDATE) {}
+ MDirUpdate() : Message(MSG_MDS_DIRUPDATE), tried_discover(0) {}
MDirUpdate(mds_rank_t f,
dirfrag_t dirfrag,
int dir_rep,
compact_set<int>& dir_rep_by,
filepath& path,
bool discover = false) :
- Message(MSG_MDS_DIRUPDATE) {
+ Message(MSG_MDS_DIRUPDATE), tried_discover(0) {
this->from_mds = f;
this->dirfrag = dirfrag;
this->dir_rep = dir_rep;
this->dir_rep_by = dir_rep_by;
- if (discover) this->discover = 5;
- else this->discover = 0;
+ this->discover = discover ? 5 : 0;
this->path = path;
}
private: