From: Greg Farnum Date: Mon, 26 Aug 2013 21:38:30 +0000 (-0700) Subject: ReplicatedPG: remove long-dead branch X-Git-Tag: v0.69~40^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37bba41be6cc195629753f5ca844776233d332d1;p=ceph.git ReplicatedPG: remove long-dead branch This was confusing the heck out of me when trying to figure out why I was hitting an assert. So replace the if-else block with a more appropriate assert and don't include any misleading calls to prepare_transaction() from sub_op_modify(). Signed-off-by: Greg Farnum --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 77774ea01ff..516ac745edc 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -4901,71 +4901,41 @@ void ReplicatedPG::sub_op_modify(OpRequestRef op) rm->epoch_started = get_osdmap()->get_epoch(); if (!m->noop) { - if (m->logbl.length()) { - // shipped transaction and log entries - vector log; - - bufferlist::iterator p = m->get_data().begin(); - - ::decode(rm->opt, p); - if (!(m->get_connection()->get_features() & CEPH_FEATURE_OSD_SNAPMAPPER)) - rm->opt.set_tolerate_collection_add_enoent(); - p = m->logbl.begin(); - ::decode(log, p); - if (m->hobject_incorrect_pool) { - for (vector::iterator i = log.begin(); - i != log.end(); - ++i) { - if (i->soid.pool == -1) - i->soid.pool = info.pgid.pool(); - } - rm->opt.set_pool_override(info.pgid.pool()); + assert(m->logbl.length()); + // shipped transaction and log entries + vector log; + + bufferlist::iterator p = m->get_data().begin(); + + ::decode(rm->opt, p); + if (!(m->get_connection()->get_features() & CEPH_FEATURE_OSD_SNAPMAPPER)) + rm->opt.set_tolerate_collection_add_enoent(); + p = m->logbl.begin(); + ::decode(log, p); + if (m->hobject_incorrect_pool) { + for (vector::iterator i = log.begin(); + i != log.end(); + ++i) { + if (i->soid.pool == -1) + i->soid.pool = info.pgid.pool(); } - rm->opt.set_replica(); - - info.stats = m->pg_stats; - if (!rm->opt.empty()) { - // If the opt is non-empty, we infer we are before - // last_backfill (according to the primary, not our - // not-quite-accurate value), and should update the - // collections now. Otherwise, we do it later on push. - update_snap_map(log, rm->localt); - } - append_log(log, m->pg_trim_to, rm->localt); - - rm->tls.push_back(&rm->localt); - rm->tls.push_back(&rm->opt); - - } else { - // do op - assert(0); - - // TODO: this is severely broken because we don't know whether this object is really lost or - // not. We just always assume that it's not right now. - // Also, we're taking the address of a variable on the stack. - object_info_t oi(soid); - oi.lost = false; // I guess? - oi.version = m->old_version; - oi.size = m->old_size; - ObjectState obs(oi, m->old_exists); - SnapSetContext ssc(m->poid.oid); - - rm->ctx = new OpContext(op, m->reqid, m->ops, &obs, &ssc, this); - - rm->ctx->mtime = m->mtime; - rm->ctx->at_version = m->version; - rm->ctx->snapc = m->snapc; + rm->opt.set_pool_override(info.pgid.pool()); + } + rm->opt.set_replica(); - ssc.snapset = m->snapset; - rm->ctx->obc->ssc = &ssc; - - prepare_transaction(rm->ctx); - append_log(rm->ctx->log, m->pg_trim_to, rm->ctx->local_t); - - rm->tls.push_back(&rm->ctx->op_t); - rm->tls.push_back(&rm->ctx->local_t); + info.stats = m->pg_stats; + if (!rm->opt.empty()) { + // If the opt is non-empty, we infer we are before + // last_backfill (according to the primary, not our + // not-quite-accurate value), and should update the + // collections now. Otherwise, we do it later on push. + update_snap_map(log, rm->localt); } + append_log(log, m->pg_trim_to, rm->localt); + rm->tls.push_back(&rm->localt); + rm->tls.push_back(&rm->opt); + rm->bytes_written = rm->opt.get_encoded_bytes(); } else {