int Objecter::recalc_op_target(Op *op)
{
- vector<int> acting;
- pg_t pgid = op->pgid;
-
bool is_read = op->flags & CEPH_OSD_FLAG_READ;
bool is_write = op->flags & CEPH_OSD_FLAG_WRITE;
}
}
+ pg_t pgid;
if (op->precalc_pgid) {
assert(op->base_oid.name.empty()); // make sure this is a listing op
- ldout(cct, 10) << "recalc_op_target have " << pgid << " pool " << osdmap->have_pg_pool(pgid.pool()) << dendl;
- if (!osdmap->have_pg_pool(pgid.pool()))
+ ldout(cct, 10) << "recalc_op_target have " << op->base_pgid << " pool "
+ << osdmap->have_pg_pool(op->base_pgid.pool()) << dendl;
+ if (!osdmap->have_pg_pool(op->base_pgid.pool()))
return RECALC_OP_TARGET_POOL_DNE;
+ pgid = osdmap->raw_pg_to_pg(op->base_pgid);
} else {
- int ret = osdmap->object_locator_to_pg(op->target_oid, op->target_oloc, pgid);
+ int ret = osdmap->object_locator_to_pg(op->target_oid, op->target_oloc,
+ pgid);
if (ret == -ENOENT)
return RECALC_OP_TARGET_POOL_DNE;
}
+ vector<int> acting;
osdmap->pg_to_acting_osds(pgid, acting);
if (op->pgid != pgid || is_pg_changed(op->acting, acting, op->used_replica)) {
o->outbl = bl;
o->reply_epoch = &onack->epoch;
- o->pgid = pg_t(list_context->current_pg, list_context->pool_id, -1);
+ o->base_pgid = pg_t(list_context->current_pg, list_context->pool_id, -1);
o->precalc_pgid = true;
op_submit(o);
object_t target_oid;
object_locator_t target_oloc;
- pg_t pgid;
- vector<int> acting;
+ bool precalc_pgid; ///< true if we are directed at base_pgid, not base_oid
+ pg_t base_pgid; ///< explciti pg target, if any
+
+ pg_t pgid; ///< last pg we mapped to
+ vector<int> acting; ///< acting for last pg we mapped to
bool used_replica;
ConnectionRef con; // for rx buffer only
utime_t stamp;
- bool precalc_pgid;
epoch_t map_dne_bound;
bool budgeted;
int f, Context *ac, Context *co, version_t *ov) :
session(NULL), session_item(this), incarnation(0),
base_oid(o), base_oloc(ol),
+ precalc_pgid(false),
used_replica(false), con(NULL),
snapid(CEPH_NOSNAP),
outbl(NULL),
flags(f), priority(0), onack(ac), oncommit(co),
tid(0), attempts(0),
- paused(false), objver(ov), reply_epoch(NULL), precalc_pgid(false),
+ paused(false), objver(ov), reply_epoch(NULL),
map_dne_bound(0),
budgeted(false),
should_resend(true) {