]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: remove long-dead branch
authorGreg Farnum <greg@inktank.com>
Mon, 26 Aug 2013 21:38:30 +0000 (14:38 -0700)
committerGreg Farnum <greg@inktank.com>
Wed, 28 Aug 2013 00:00:44 +0000 (17:00 -0700)
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 <greg@inktank.com>
src/osd/ReplicatedPG.cc

index 77774ea01ffd7c6b8a76a0914d2520cf1ced5811..516ac745edcfeb1b297da21366323fdf2e3f1a3e 100644 (file)
@@ -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<pg_log_entry_t> 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<pg_log_entry_t>::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<pg_log_entry_t> 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<pg_log_entry_t>::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 {