]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: make _sub_got behave if we "got" old stuff
authorSage Weil <sage@redhat.com>
Fri, 13 Nov 2015 18:03:16 +0000 (13:03 -0500)
committerSage Weil <sage@redhat.com>
Mon, 23 Nov 2015 13:38:51 +0000 (08:38 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonClient.h

index 70b84b3537d60209332d624c6b56e40a7ac4f0ca..c3efd78f866601b98e052f2c8a9eea7fc5a0e418 100644 (file)
@@ -231,15 +231,19 @@ private:
   }
   void _sub_got(string what, version_t got) {
     if (sub_new.count(what)) {
-      if (sub_new[what].flags & CEPH_SUBSCRIBE_ONETIME)
-       sub_new.erase(what);
-      else
-       sub_new[what].start = got + 1;
+      if (sub_new[what].start <= got) {
+       if (sub_new[what].flags & CEPH_SUBSCRIBE_ONETIME)
+         sub_new.erase(what);
+       else
+         sub_new[what].start = got + 1;
+      }
     } else if (sub_sent.count(what)) {
-      if (sub_sent[what].flags & CEPH_SUBSCRIBE_ONETIME)
-       sub_sent.erase(what);
-      else
-       sub_sent[what].start = got + 1;
+      if (sub_sent[what].start <= got) {
+       if (sub_sent[what].flags & CEPH_SUBSCRIBE_ONETIME)
+         sub_sent.erase(what);
+       else
+         sub_sent[what].start = got + 1;
+      }
     }
   }
   void _sub_unwant(string what) {