// insert trace
if (reply->get_result() >= 0) {
utime_t ttl = request.sent_stamp;
- ttl += 1000.0 * (float)reply->get_lease_duration_ms();
+ float dur = (float)reply->get_lease_duration_ms() / 1000.0;
+ ttl += dur;
+ dout(20) << "make_request got ttl of " << ttl
+ << " (sent_stamp " << request.sent_stamp
+ << " + " << dur << "s"
+ << ")" << dendl;
Inode *in = insert_trace(reply, ttl);
if (ppin)
*ppin = in;
r->set_mdsmap_epoch(mdsmap->get_epoch());
- if (request->mds.empty())
+ if (request->mds.empty()) {
request->sent_stamp = g_clock.now();
+ dout(20) << "send_request set sent_stamp to " << request->sent_stamp << dendl;
+ }
dout(10) << "send_request " << *r << " to mds" << mds << dendl;
messenger->send_message(r, mdsmap->get_inst(mds));
mds_cap_timeout: 100, // cap bits time out if client idle
mds_session_autoclose: 300, // autoclose idle session
- mds_client_lease: 100,
+ mds_client_lease: 30,
mds_tick_interval: 5,
+void MDCache::trim_client_replicas()
+{
+ dout(10) << "trim_client_replicas start - " << client_replicas.size() << " replicas" << dendl;
+
+ utime_t now = g_clock.now();
+ while (!client_replicas.empty()) {
+ ClientReplica *r = client_replicas.front();
+ if (r->ttl > now) break;
+ MDSCacheObject *p = r->parent;
+ dout(10) << " expiring client" << r->client << " replica of " << *p << dendl;
+ p->remove_client_replica(r);
+ }
+
+ dout(10) << "trim_client_replicas finish - " << client_replicas.size() << " replicas" << dendl;
+}
+
+
+
// =========================================================================================
// shutdown
void send_expire_messages(map<int, MCacheExpire*>& expiremap);
void trim_non_auth(); // trim out trimmable non-auth items
+ void trim_client_replicas();
+
// shutdown
void shutdown_start();
void shutdown_check();
// trim cache
mdcache->trim();
+ mdcache->trim_client_replicas();
}