]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: pass EAGAIN to is_latest_map() callers
authorSage Weil <sage@inktank.com>
Mon, 27 Aug 2012 04:17:05 +0000 (21:17 -0700)
committerSage Weil <sage@inktank.com>
Tue, 28 Aug 2012 00:25:56 +0000 (17:25 -0700)
If our map get_version check needs to be retried, tell the
is_latest_map() callers instead of giving returning 0 ("no").

Fixes: #3049
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/MonClient.cc
src/mon/MonClient.h

index 62f0e9d7484c629109604d9f25dfab01b2c26f0b..ed8e07bda7e39b711940988f3fe4cb6e386f72a1 100644 (file)
@@ -696,7 +696,7 @@ struct C_IsLatestMap : public Context {
   version_t have;
   C_IsLatestMap(Context *f, version_t h) : onfinish(f), have(h) {}
   void finish(int r) {
-    onfinish->complete(have != newest);
+    onfinish->complete(r == 0 ? (have != newest) : r);
   }
 };
 
index d56d3ec31e15dccb69834620e5adc9e143183abc..2b117b9cdc49cbcedd31d8967f2cf9258e60e4b4 100644 (file)
@@ -245,6 +245,14 @@ public:
 
   // version requests
 public:
+  /**
+   * check if we have the latest version of a map
+   *
+   * @param map name of map (e.g., 'osdmap')
+   * @param cur_ver version we have
+   * @param onfinish completion
+   * @return (via context) 1 if cur_ver is the latest, 0 if it is not, -EAGAIN if we need to retry
+   */
   void is_latest_map(string map, version_t cur_ver, Context *onfinish);
 
   /**