]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix pg log entry types to not always be delete
authorSage Weil <sage@newdream.net>
Tue, 3 May 2011 20:08:35 +0000 (13:08 -0700)
committerSage Weil <sage@newdream.net>
Tue, 3 May 2011 20:08:35 +0000 (13:08 -0700)
This was broken by the osd_trans work merged in 01f3526b62.  We need to
use the obs reference to new_obs.  This caused objects to be deleted during
pg recovery.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/ReplicatedPG.cc

index 4a572e0cd7e8f814f6e29b4cf143b300855c11ef..6c8b58e795fb47d5f381b9117fa93cbe466d3fb4 100644 (file)
@@ -2279,7 +2279,7 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx)
 
   // append to log
   int logopcode = Log::Entry::MODIFY;
-  if (!ctx->obs->exists)
+  if (!obs.exists)
     logopcode = Log::Entry::DELETE;
   ctx->log.push_back(Log::Entry(logopcode, soid, ctx->at_version, old_version,
                                ctx->reqid, ctx->mtime));
@@ -4530,7 +4530,8 @@ void ReplicatedPG::clean_up_local(ObjectStore::Transaction& t)
     for (list<Log::Entry>::reverse_iterator p = log.log.rbegin();
          p != log.log.rend();
          p++) {
-      if (did.count(p->soid)) continue;
+      if (did.count(p->soid))
+       continue;
       did.insert(p->soid);
 
       if (p->is_delete()) {