From: Kefu Chai Date: Mon, 15 Aug 2016 07:42:29 +0000 (+0800) Subject: osd: set objecter.osdmap when starts X-Git-Tag: v11.0.1~421^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1515e08e7d425f01d2e9d02c34b2ae40cdf2611a;p=ceph.git osd: set objecter.osdmap when starts 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 6b0782621ffe..29f20e66c682 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -506,7 +506,7 @@ void OSDService::init() void OSDService::final_init() { - objecter->start(); + objecter->start(osdmap.get()); } void OSDService::activate_map() diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 503f5cab0c83..be0e17e9d32f 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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(); } } diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 2e2022e4b4b6..d5d6e529dd93 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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