]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: make the PG's SORTBITWISE assert a more generous shutdown 18132/head
authorGreg Farnum <gfarnum@redhat.com>
Fri, 29 Sep 2017 22:18:26 +0000 (15:18 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Thu, 5 Oct 2017 17:50:59 +0000 (10:50 -0700)
We want to stop working if we get activated while sortbitwise is not set
on the cluster, but we might have old maps where it wasn't if the flag
was changed recently. And doing it in the PG code was a bit silly anyway.

Instead check SORTBITWISE in the main OSDMap handling code prior to
prepublishing it. Let it go through if we aren't active at the time.

Fixes: http://tracker.ceph.com/issues/20416
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit 0a691b2b1c19fbc30af5c4046736dacb2fb8bfa4)

src/osd/OSD.cc
src/osd/PG.cc

index 426da2440089115065c5c2e191580b1137636ee0..0eae4cc37f05ae9882234f455a8e406f7a9d93c8 100644 (file)
@@ -8171,6 +8171,15 @@ void OSD::consume_map()
   assert(osd_lock.is_locked());
   dout(7) << "consume_map version " << osdmap->get_epoch() << dendl;
 
+  /** make sure the cluster is speaking in SORTBITWISE, because we don't
+   *  speak the older sorting version any more. Be careful not to force
+   *  a shutdown if we are merely processing old maps, though.
+   */
+  if (!osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE) && is_active()) {
+    derr << __func__ << " SORTBITWISE flag is not set" << dendl;
+    ceph_abort();
+  }
+
   int num_pg_primary = 0, num_pg_replica = 0, num_pg_stray = 0;
   list<PGRef> to_remove;
 
@@ -8252,11 +8261,6 @@ void OSD::activate_map()
 
   dout(7) << "activate_map version " << osdmap->get_epoch() << dendl;
 
-  if (!osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE)) {
-    derr << __func__ << " SORTBITWISE flag is not set" << dendl;
-    ceph_abort();
-  }
-
   if (osdmap->test_flag(CEPH_OSDMAP_FULL)) {
     dout(10) << " osdmap flagged full, doing onetime osdmap subscribe" << dendl;
     osdmap_subscribe(osdmap->get_epoch() + 1, false);
index da4da001e0404e2b8daca753cdafc320359e303b..2b1b577e27d1bf1b134adba1c1d178adecddd4e1 100644 (file)
@@ -5530,8 +5530,6 @@ void PG::on_new_interval()
     upacting_features &= osdmap->get_xinfo(*p).features;
   }
 
-  assert(osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE));
-
   _on_new_interval();
 }