// Populate Op::target
OSDSession *s = NULL;
- _calc_target(&info->target);
+ _calc_target(&info->target, nullptr);
// Create LingerOp<->OSDSession relation
int r = _get_session(info->target.osd, &s, sul);
if (pool_full_map)
force_resend_writes = force_resend_writes ||
(*pool_full_map)[op->target.base_oloc.pool];
- int r = _calc_target(&op->target);
+ int r = _calc_target(&op->target,
+ op->session ? op->session->con.get() : nullptr);
switch (r) {
case RECALC_OP_TARGET_NO_ACTION:
if (!force_resend &&
p != need_resend_linger.end(); ++p) {
LingerOp *op = *p;
if (!op->session) {
- _calc_target(&op->target);
+ _calc_target(&op->target, nullptr);
OSDSession *s = NULL;
int const r = _get_session(op->target.osd, &s, sul);
assert(r == 0);
assert(op->session == NULL);
OSDSession *s = NULL;
- bool check_for_latest_map = _calc_target(&op->target)
+ bool check_for_latest_map = _calc_target(&op->target, nullptr)
== RECALC_OP_TARGET_POOL_DNE;
// Try to get a session, including a retry if we need to take write lock
// map changed; recalculate mapping
ldout(cct, 10) << __func__ << " relock raced with osdmap, recalc target"
<< dendl;
- check_for_latest_map = _calc_target(&op->target)
+ check_for_latest_map = _calc_target(&op->target, nullptr)
== RECALC_OP_TARGET_POOL_DNE;
if (s) {
put_session(s);
return p->raw_hash_to_pg(p->hash_key(key, ns));
}
-int Objecter::_calc_target(op_target_t *t, bool any_change)
+int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
{
// rwlock is locked
&acting, &acting_primary);
bool sort_bitwise = osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE);
unsigned prev_seed = ceph_stable_mod(pgid.ps(), t->pg_num, t->pg_num_mask);
+ pg_t prev_pgid(prev_seed, pgid.pool());
if (any_change && pg_interval_t::is_new_interval(
t->acting_primary,
acting_primary,
pg_num,
t->sort_bitwise,
sort_bitwise,
- pg_t(prev_seed, pgid.pool(), pgid.preferred()))) {
+ prev_pgid)) {
force_resend = true;
}
t->paused = false;
need_resend = true;
}
-
if (t->pgid != pgid ||
is_pg_changed(
t->acting_primary, t->acting, acting_primary, acting,
t->used_replica || any_change) ||
+ (con && con->has_features(CEPH_FEATUREMASK_RESEND_ON_SPLIT) &&
+ prev_pgid.is_split(t->pg_num, pg_num, nullptr)) ||
force_resend) {
t->pgid = pgid;
t->acting = acting;
int Objecter::_map_session(op_target_t *target, OSDSession **s,
shunique_lock& sul)
{
- _calc_target(target);
+ _calc_target(target, nullptr);
return _get_session(target->osd, s, sul);
}
{
// rwlock is locked unique
- int r = _calc_target(&linger_op->target,
- true);
+ int r = _calc_target(&linger_op->target, nullptr, true);
if (r == RECALC_OP_TARGET_NEED_RESEND) {
ldout(cct, 10) << "recalc_linger_op_target tid " << linger_op->linger_id
<< " pgid " << linger_op->target.pgid
}
c->target.osd = c->target_osd;
} else {
- int ret = _calc_target(&(c->target), true);
+ int ret = _calc_target(&(c->target), nullptr, true);
if (ret == RECALC_OP_TARGET_POOL_DNE) {
c->map_check_error = -ENOENT;
c->map_check_error_str = "pool dne";