]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "ReplicatedPG: fill in user log entry last after snapdir tran"
authorSage Weil <sage@inktank.com>
Tue, 4 Sep 2012 22:21:45 +0000 (15:21 -0700)
committerSage Weil <sage@inktank.com>
Tue, 4 Sep 2012 22:21:45 +0000 (15:21 -0700)
This reverts commit 0aad5462eb79be0427004f2442903bb56c2057c1.

This gives us two events with the same version, and crashes like so:

osd/PG.cc: In function 'void PG::add_log_entry(pg_log_entry_t&, ceph::bufferlist&)' thread 7fd21b187700 time 2012-09-04 15:10:39.475385
osd/PG.cc: 2181: FAILED assert(e.version > info.last_update)

 ceph version 0.51-411-g40fd6ba (commit:40fd6ba8ed9ba70c8d20a79936f53f10f2dfe839)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x95) [0x1025139]
 2: (PG::add_log_entry(pg_log_entry_t&, ceph::buffer::list&)+0xb0) [0xe47552]
 3: (PG::append_log(std::vector<pg_log_entry_t, std::allocator<pg_log_entry_t> >&, eversion_t, ObjectStore::Transaction&)+0x1cd) [0xe47939]
 4: (ReplicatedPG::do_op(std::tr1::shared_ptr<OpRequest>)+0x41f2) [0xcb5c84]
 5: (PG::do_request(std::tr1::shared_ptr<OpRequest>)+0x1f3) [0xe42329]
 6: (OSD::dequeue_op(PG*)+0x286) [0xd9a214]
 7: (OSD::OpWQ::_process(PG*)+0x27) [0xda20e7]
 8: (ThreadPool::WorkQueue<PG>::_void_process(void*)+0x2e) [0xdf1ab4]
 9: (ThreadPool::worker()+0x4ce) [0x101c762]
 10: (ThreadPool::WorkThread::entry()+0x1c) [0xda049e]
 11: (Thread::_entry_func(void*)+0x23) [0x1016a49]
 12: (()+0x7e9a) [0x7fd22b7fce9a]
 13: (clone()+0x6d) [0x7fd229db14bd]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

src/osd/ReplicatedPG.cc

index ab7cb2bd899e10f5b5437b532fbf6e1d5ebd0bd7..005ef0109b70d5684b5935232751105920bb41aa 100644 (file)
@@ -3268,6 +3268,13 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx)
   ::encode(ctx->new_snapset, bss);
   assert(ctx->new_obs.exists == ctx->new_snapset.head_exists);
 
+  // append to log
+  int logopcode = pg_log_entry_t::MODIFY;
+  if (!ctx->new_obs.exists)
+    logopcode = pg_log_entry_t::DELETE;
+  ctx->log.push_back(pg_log_entry_t(logopcode, soid, ctx->at_version, old_version,
+                               ctx->reqid, ctx->mtime));
+
   if (ctx->new_obs.exists) {
     ctx->new_obs.oi.version = ctx->at_version;
     ctx->new_obs.oi.prior_version = old_version;
@@ -3328,13 +3335,6 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx)
     ctx->op_t.setattr(coll, snapoid, SS_ATTR, bss);
   }
 
-  // append to log
-  int logopcode = pg_log_entry_t::MODIFY;
-  if (!ctx->new_obs.exists)
-    logopcode = pg_log_entry_t::DELETE;
-  ctx->log.push_back(pg_log_entry_t(logopcode, soid, ctx->at_version, old_version,
-                               ctx->reqid, ctx->mtime));
-
   // apply new object state.
   ctx->obc->obs = ctx->new_obs;
   ctx->obc->ssc->snapset = ctx->new_snapset;