]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: reset seq on mds after reconnect, too
authorSage Weil <sage@newdream.net>
Tue, 14 Jul 2009 20:46:10 +0000 (13:46 -0700)
committerSage Weil <sage@newdream.net>
Tue, 14 Jul 2009 20:46:10 +0000 (13:46 -0700)
We were setting it to 1 (due to the issue_norevoke() call), but the
client is resetting to 0, so do the same here.  (Otherwise
subsequent client cap messages may get ignored.)

src/mds/CInode.cc
src/mds/CInode.h
src/mds/Capability.h

index f183394a89521fd78909e4186b8b478ce9728e2a..ac7e3faa1a7e9ee7f28b98810dd1690a0a048bd0 100644 (file)
@@ -148,7 +148,8 @@ ostream& operator<<(ostream& out, CInode& in)
          it++) {
       if (it != in.get_client_caps().begin()) out << ",";
       out << it->first << "=" << ccap_string(it->second->issued())
-         << "/" << ccap_string(it->second->wanted());
+         << "/" << ccap_string(it->second->wanted())
+         << "@" << it->second->get_last_sent();
     }
     out << "}";
     if (in.get_loner() >= 0)
index c642604124f3b65ada0b4f15eddecf7687bad9f8..a51070bcf0df303fcfc77670fa86f0c1c77eee56 100644 (file)
@@ -670,11 +670,13 @@ public:
   Capability *reconnect_cap(int client, ceph_mds_cap_reconnect& icr, Session *session) {
     Capability *cap = get_client_cap(client);
     if (cap) {
+      // FIXME?
       cap->merge(icr.wanted, icr.issued);
     } else {
       cap = add_client_cap(client, session);
       cap->set_wanted(icr.wanted);
       cap->issue_norevoke(icr.issued);
+      cap->reset_seq();
     }
     cap->set_cap_id(icr.cap_id);
     cap->set_last_issue_stamp(g_clock.recent_now());
index 88af4d8c3eb73777179ba21098c98ef6875c24f6..41f1daa8ee76920fd641a0d2fb88fcc18549fd37 100644 (file)
@@ -239,6 +239,10 @@ public:
   ceph_seq_t get_last_seq() { return last_sent; }
   ceph_seq_t get_last_issue() { return last_issue; }
 
+  void reset_seq() {
+    last_sent = 0;
+    last_issue = 0;
+  }
   
   // -- exports --
   Export make_export() {