Option("mds_request_load_average_decay_rate", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(60)
.set_description("rate of decay in seconds for calculating request load average"),
+
+ Option("mds_cap_revoke_eviction_timeout", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
+ .set_default(0)
+ .set_description("number of seconds after which clients which have not responded to cap revoke messages by the MDS are evicted."),
});
}
"host",
"fsid",
"mds_request_load_average_decay_rate",
+ "mds_cap_revoke_eviction_timeout",
NULL
};
return KEYS;
#include "MDBalancer.h"
#include "Migrator.h"
#include "Locker.h"
-#include "Server.h"
#include "InoTable.h"
#include "mon/MonClient.h"
#include "common/HeartbeatMap.h"
// ...
if (is_clientreplay() || is_active() || is_stopping()) {
server->find_idle_sessions();
+ server->evict_cap_revoke_non_responders();
locker->tick();
}
#include "MDLog.h"
#include "MDSContext.h"
#include "PurgeQueue.h"
+#include "Server.h"
#include "osdc/Journaler.h"
// Full .h import instead of forward declaration for PerfCounter, for the
struct heartbeat_handle_d;
}
-class Server;
class Locker;
class MDCache;
class MDLog;
const std::set <std::string> &changed)
{
sessionmap.handle_conf_change(conf, changed);
+ server->handle_conf_change(conf, changed);
mdcache->handle_conf_change(conf, changed, *mdsmap);
purge_queue.handle_conf_change(conf, changed, *mdsmap);
}
}
}
+void Server::evict_cap_revoke_non_responders() {
+ if (!cap_revoke_eviction_timeout) {
+ return;
+ }
+
+ std::list<client_t> to_evict;
+ mds->locker->get_late_revoking_clients(&to_evict, cap_revoke_eviction_timeout);
+
+ for (auto const &client: to_evict) {
+ mds->clog->warn() << "client id " << client << " has not responded to"
+ << " cap revoke by MDS for over " << cap_revoke_eviction_timeout
+ << " seconds, evicting";
+ dout(1) << __func__ << ": evicting cap revoke non-responder client id "
+ << client << dendl;
+
+ std::stringstream ss;
+ mds->evict_client(client.v, false, g_conf()->mds_session_blacklist_on_evict,
+ ss, nullptr);
+ }
+}
+
+void Server::handle_conf_change(const ConfigProxy& conf,
+ const std::set <std::string> &changed) {
+ if (changed.count("mds_cap_revoke_eviction_timeout")) {
+ cap_revoke_eviction_timeout = g_conf().get_val<double>("mds_cap_revoke_eviction_timeout");
+ dout(20) << __func__ << " cap revoke eviction timeout changed to "
+ << cap_revoke_eviction_timeout << dendl;
+ }
+}
+
/*
* XXX bump in the interface here, not using an MDSInternalContextBase here
* because all the callers right now happen to use a SaferCond
feature_bitset_t supported_features;
feature_bitset_t required_client_features;
+ double cap_revoke_eviction_timeout = 0;
+
friend class MDSContinuation;
friend class ServerContext;
friend class ServerLogContext;
CDentry *destdn, CDentry *staydn, map<client_t,MClientSnap::ref> splits[2],
bool finish_mdr);
+ void evict_cap_revoke_non_responders();
+ void handle_conf_change(const ConfigProxy& conf,
+ const std::set <std::string> &changed);
+
private:
void reply_client_request(MDRequestRef& mdr, const MClientReply::ref &reply);
};