* leases
*/
+void Client::got_mds_push(int mds)
+{
+ MDSSession& s = mds_sessions[mds];
+
+ s.seq++;
+ dout(10) << " mds" << mds << " seq now " << s.seq << dendl;
+ if (s.closing)
+ messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_CLOSE, s.seq),
+ s.inst);
+}
+
void Client::handle_lease(MClientLease *m)
{
dout(10) << "handle_lease " << *m << dendl;
assert(m->get_action() == CEPH_MDS_LEASE_REVOKE);
int mds = m->get_source().num();
- mds_sessions[mds].seq++;
+ got_mds_push(mds);
ceph_seq_t seq = m->get_seq();
{
dout(10) << "handle_snap " << *m << dendl;
int mds = m->get_source().num();
-
- mds_sessions[mds].seq++;
+ got_mds_push(mds);
list<Inode*> to_move;
SnapRealm *realm = 0;
m->clear_payload(); // for if/when we send back to MDS
- // note push seq increment
- if (mds_sessions.count(mds) == 0)
- dout(0) << "got file_caps without session from mds" << mds << " msg " << *m << dendl;
- //assert(mds_sessions.count(mds)); // HACK FIXME SOON
- mds_sessions[mds].seq++;
+ got_mds_push(mds);
Inode *in = 0;
vinodeno_t vino(m->get_ino(), CEPH_NOSNAP);
++p) {
dout(2) << "sending client_session close to mds" << p->first
<< " seq " << p->second.seq << dendl;
+ p->second.closing = true;
messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_CLOSE, p->second.seq),
mdsmap->get_inst(p->first));
}
utime_t cap_ttl, last_cap_renew_request;
int num_caps;
entity_inst_t inst;
+ bool closing;
MClientCapRelease *release;
- MDSSession() : seq(0), cap_gen(0), num_caps(0), release(NULL) {}
+ MDSSession() : seq(0), cap_gen(0), num_caps(0), closing(false), release(NULL) {}
};
map<int, MDSSession> mds_sessions; // mds -> push seq
map<int, list<Cond*> > waiting_for_session;
list<Cond*> waiting_for_mdsmap;
+ void got_mds_push(int mds);
void handle_client_session(MClientSession *m);
void send_reconnect(int mds);