]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: use full hash value for pg[n]ls ops
authorSage Weil <sage@redhat.com>
Wed, 30 Mar 2016 15:55:55 +0000 (11:55 -0400)
committerSage Weil <sage@redhat.com>
Sun, 3 Apr 2016 13:45:56 +0000 (09:45 -0400)
Normal ops do this so they can behave when racing with split; pgnls ops
are no different.

In particular, this fixes a bug where we have an old OSDMap that doesn't
reflect a split, and the OSD replies with a 'next' value of the PG's new
max.  If we resend the same value to that PG, it'll be out of bounds,
and BlueStore will notice.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.cc

index d184b446b367954de87f23e28d8d214629331587..b208254eba683cef71e35dea18e985bf06ed5f62 100644 (file)
@@ -2663,7 +2663,15 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend,
       t->osd = -1;
       return RECALC_OP_TARGET_POOL_DNE;
     }
-    pgid = osdmap->raw_pg_to_pg(t->base_pgid);
+    if (osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE)) {
+      // if the SORTBITWISE flag is set, we know all OSDs are running
+      // jewel+.
+      pgid = t->base_pgid;
+    } else {
+      // legacy behavior.  pre-jewel OSDs will fail if we send a
+      // full-hash pgid value.
+      pgid = osdmap->raw_pg_to_pg(t->base_pgid);
+    }
   } else {
     int ret = osdmap->object_locator_to_pg(t->target_oid, t->target_oloc,
                                           pgid);