]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set objecter.osdmap when starts 10804/head
authorKefu Chai <kchai@redhat.com>
Mon, 15 Aug 2016 07:42:29 +0000 (15:42 +0800)
committerLoic Dachary <ldachary@redhat.com>
Sun, 21 Aug 2016 20:23:26 +0000 (22:23 +0200)
if any OSD is full or the pause flag is set in cluster, objecter will
always try to subscribe the next osdmap using the mon client shared with
OSD. but if the OSD's osdmap is very far behind on osd maps due to some
reasons, `MonClient::sub_want_increment()` will reject the subscribe
request from OSD, because it's asking for older maps while the mon client
is about to send the request from objecter for the *next* osdmap.

so we need to update objecter with the latest local osdmap, so it is
able to skip the new osdmaps if OSD needs to catch up with the cluster
first.

Fixes: http://tracker.ceph.com/issues/17023
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 1515e08e7d425f01d2e9d02c34b2ae40cdf2611a)

src/osd/OSD.cc
src/osdc/Objecter.cc
src/osdc/Objecter.h

index b85083b724fc32de515ac44c9761be9be2c89c0b..8eb2397260492febb9dc1a55f60a637f4f19b1ba 100644 (file)
@@ -499,7 +499,7 @@ void OSDService::init()
 
 void OSDService::final_init()
 {
-  objecter->start();
+  objecter->start(osdmap.get());
 }
 
 void OSDService::activate_map()
index 2f028cf3e73d5bc9cae9750586f9cf382131d6c6..45c7e660a2d1550c7eccc83b8bddd2fa4544efa7 100644 (file)
@@ -358,12 +358,14 @@ void Objecter::init()
 /*
  * ok, cluster interaction can happen
  */
-void Objecter::start()
+void Objecter::start(const OSDMap* o)
 {
   shared_lock rl(rwlock);
 
   start_tick();
-  if (osdmap->get_epoch() == 0) {
+  if (o) {
+    osdmap->deepish_copy_from(*o);
+  } else if (osdmap->get_epoch() == 0) {
     _maybe_request_map();
   }
 }
index 6b519ffd8d5a81c30ac3e4f38fd4096def24e0a9..8167306dd8517c02da6596d1748cd14440a15883 100644 (file)
@@ -1973,7 +1973,7 @@ private:
   ~Objecter();
 
   void init();
-  void start();
+  void start(const OSDMap *o = nullptr);
   void shutdown();
 
   // These two templates replace osdmap_(get)|(put)_read. Simply wrap