// Populate Op::target
OSDSession *s = NULL;
- _calc_target(&info->target, &info->last_force_resend);
+ _calc_target(&info->target);
// 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, &op->last_force_resend);
+ int r = _calc_target(&op->target);
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, &op->last_force_resend);
+ _calc_target(&op->target);
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, &op->last_force_resend)
+ bool check_for_latest_map = _calc_target(&op->target)
== 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, &op->last_force_resend)
+ check_for_latest_map = _calc_target(&op->target)
== 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, epoch_t *last_force_resend,
- bool any_change)
+int Objecter::_calc_target(op_target_t *t, bool any_change)
{
// rwlock is locked
bool force_resend = false;
bool need_check_tiering = false;
if (osdmap->get_epoch() == pi->last_force_op_resend) {
- if (last_force_resend && *last_force_resend < pi->last_force_op_resend) {
- *last_force_resend = pi->last_force_op_resend;
+ if (t->last_force_resend < pi->last_force_op_resend) {
+ t->last_force_resend = pi->last_force_op_resend;
force_resend = true;
- } else if (last_force_resend == 0)
+ } else if (t->last_force_resend == 0) {
force_resend = true;
+ }
}
if (t->target_oid.name.empty() || force_resend) {
t->target_oid = t->base_oid;
{
// rwlock is locked unique
- int r = _calc_target(&linger_op->target, &linger_op->last_force_resend,
+ int r = _calc_target(&linger_op->target,
true);
if (r == RECALC_OP_TARGET_NEED_RESEND) {
ldout(cct, 10) << "recalc_linger_op_target tid " << linger_op->linger_id
bool used_replica;
bool paused;
+ epoch_t last_force_resend = 0;
int osd; ///< the final target osd, or -1
op_target_t(object_t oid, object_locator_t oloc, int flags)
int *data_offset;
- epoch_t last_force_resend;
-
osd_reqid_t reqid; // explicitly setting reqid
Op(const object_t& o, const object_locator_t& ol, vector<OSDOp>& op,
budgeted(false),
should_resend(true),
ctx_budgeted(false),
- data_offset(offset),
- last_force_resend(0) {
+ data_offset(offset) {
ops.swap(op);
/* initialize out_* to match op vector */
ceph_tid_t ping_tid;
epoch_t map_dne_bound;
- epoch_t last_force_resend;
-
void _queued_async() {
// watch_lock ust be locked unique
watch_pending_async.push_back(ceph::mono_clock::now());
session(NULL),
register_tid(0),
ping_tid(0),
- map_dne_bound(0),
- last_force_resend(0) {}
+ map_dne_bound(0) {}
// no copy!
const LingerOp &operator=(const LingerOp& r);
bool _osdmap_has_pool_full() const;
bool target_should_be_paused(op_target_t *op);
- int _calc_target(op_target_t *t, epoch_t *last_force_resend = 0,
+ int _calc_target(op_target_t *t,
bool any_change = false);
int _map_session(op_target_t *op, OSDSession **s,
shunique_lock& lc);