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 <sage@redhat.com>
This commit is contained in:
Sage Weil 2016-03-30 11:55:55 -04:00
parent 9196a75459
commit f16187f68d

View 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);