From: Sage Weil Date: Wed, 30 Mar 2016 15:55:55 +0000 (-0400) Subject: osdc/Objecter: use full hash value for pg[n]ls ops X-Git-Tag: v10.1.1~8^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f16187f68d7f494fd5ed243e163a8ae3cb111cd3;p=ceph.git osdc/Objecter: use full hash value for pg[n]ls ops 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 --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index d184b446b367..b208254eba68 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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);