For rank, if there is a standby replay rank, we don't use
fadvise_dontneed for write ops. Except this case, we use
fadvise_dontneed for write ops.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
g_ceph_context->get_perfcounters_collection()->add(logger);
}
+void MDLog::set_write_iohint(unsigned iohint_flags)
+{
+ journaler->set_write_iohint(iohint_flags);
+}
+
class C_MDL_WriteError : public MDSIOContextBase {
protected:
MDLog *mdlog;
// replay state
map<inodeno_t, set<inodeno_t> > pending_exports;
-
+ void set_write_iohint(unsigned iohint_flags);
public:
MDLog(MDSRank *m) : mds(m),
set_osd_epoch_barrier(osd_epoch);
}
+ if (is_active()) {
+ bool found = false;
+ MDSMap::mds_info_t info = mdsmap->get_info(whoami);
+
+ for (map<mds_gid_t,MDSMap::mds_info_t>::const_iterator p = mdsmap->get_mds_info().begin();
+ p != mdsmap->get_mds_info().end();
+ ++p) {
+ if (p->second.state == MDSMap::STATE_STANDBY_REPLAY &&
+ (p->second.standby_for_rank == whoami ||(info.name.length() && p->second.standby_for_name == info.name))) {
+ found = true;
+ break;
+ }
+ if (found)
+ mdlog->set_write_iohint(0);
+ else
+ mdlog->set_write_iohint(CEPH_OSD_OP_FLAG_FADVISE_DONTNEED);
+ }
+ }
+
mdcache->notify_mdsmap_changed();
}