]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set objecter.osdmap when starts 10725/head
authorKefu Chai <kchai@redhat.com>
Mon, 15 Aug 2016 07:42:29 +0000 (15:42 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 16 Aug 2016 01:19:39 +0000 (09:19 +0800)
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>
src/osd/OSD.cc
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 6b0782621ffe75c6f79c6f6653b8968445dfb1eb..29f20e66c682795a4427f82ac22fcb8cccb31ab6 100644 (file)
@@ -506,7 +506,7 @@ void OSDService::init()
 
 void OSDService::final_init()
 {
-  objecter->start();
+  objecter->start(osdmap.get());
 }
 
 void OSDService::activate_map()
index 503f5cab0c83e7b965c26509d368a584cb0a8b3a..be0e17e9d32fab2cb68aaf12221f95f4df18d8ec 100644 (file)
@@ -386,12 +386,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 2e2022e4b4b60643cd58b2eccaef974e82eaca04..d5d6e529dd93908c26510620b71279892bda1f14 100644 (file)
@@ -1957,7 +1957,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