]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only exit if *latest* map(s) say we are destroyed 20068/head
authorSage Weil <sage@redhat.com>
Wed, 17 Jan 2018 16:38:29 +0000 (10:38 -0600)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Jan 2018 10:01:36 +0000 (11:01 +0100)
It's possible our current map is older, we were destroyed then, but in
newer maps our osd was recreated.  This happens when the oldest map after
a recreated osd happens to land on an epoch where the osd was marked
destroyed.

Fix by only exiting if one of the newest maps says we are (still)
destroyed.

Fixes: http://tracker.ceph.com/issues/22673
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 4e4d6466aab259eb0436989401b80b6c3cf87a7c)

src/osd/OSD.cc

index 926a3be7e03422c9a9bff9e4f3c5914385020110..b5a1b0b593e045bf5e7abdd910800308196c29ea 100644 (file)
@@ -5856,8 +5856,12 @@ void OSD::_preboot(epoch_t oldest, epoch_t newest)
   if (osdmap->get_epoch() == 0) {
     derr << "waiting for initial osdmap" << dendl;
   } else if (osdmap->is_destroyed(whoami)) {
-    derr << "osdmap says I am destroyed, exiting" << dendl;
-    exit(0);
+    derr << "osdmap says I am destroyed" << dendl;
+    // provide a small margin so we don't livelock seeing if we
+    // un-destroyed ourselves.
+    if (osdmap->get_epoch() > newest - 1) {
+      exit(0);
+    }
   } else if (osdmap->test_flag(CEPH_OSDMAP_NOUP) || osdmap->is_noup(whoami)) {
     derr << "osdmap NOUP flag is set, waiting for it to clear" << dendl;
   } else if (!osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE)) {