]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix _scrub head_exists test
authorSage Weil <sage@newdream.net>
Fri, 26 Jun 2009 04:24:02 +0000 (21:24 -0700)
committerSage Weil <sage@newdream.net>
Fri, 26 Jun 2009 04:24:02 +0000 (21:24 -0700)
src/osd/ReplicatedPG.cc
src/osd/osd_types.h

index 4451b9b640fe9ed12d3113a145d3f09050c1bc69..9a6497c5e25885a1f3283ce55c45a33eb0df2a31 100644 (file)
@@ -1703,17 +1703,21 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx)
     bufferlist bv(sizeof(*poi));
     ::encode(*poi, bv);
     ctx->op_t.setattr(info.pgid.to_coll(), soid, OI_ATTR, bv);
-    ctx->op_t.setattr(info.pgid.to_coll(), soid, SS_ATTR, bss);
-    
+
+    dout(10) << " final snapset " << ctx->obs->ssc->snapset
+            << " in " << soid << dendl;
+    ctx->op_t.setattr(info.pgid.to_coll(), soid, SS_ATTR, bss);   
     if (!head_existed) {
       // if we logically recreated the head, remove old _snapdir object
       sobject_t snapoid(soid.oid, CEPH_SNAPDIR);
       ctx->op_t.remove(info.pgid.to_coll(), snapoid);
+      dout(10) << " removing old " << snapoid << dendl;
     }
-
   } else if (ctx->obs->ssc->snapset.clones.size()) {
     // save snapset on _snap
     sobject_t snapoid(soid.oid, CEPH_SNAPDIR);
+    dout(10) << " final snapset " << ctx->obs->ssc->snapset
+            << " in " << snapoid << dendl;
     ctx->op_t.touch(info.pgid.to_coll(), snapoid);
     ctx->op_t.setattr(info.pgid.to_coll(), snapoid, SS_ATTR, bss);
   }
@@ -3614,8 +3618,8 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed)
     //assert(data.length() == p->size);
 
     if (soid.snap == CEPH_NOSNAP) {
-      if (snapset.head_exists) {
-       dout(0) << mode << " snapset.head_exists=false, but " << soid << " exists" << dendl;
+      if (!snapset.head_exists) {
+       dout(0) << mode << "  snapset.head_exists=false, but " << soid << " exists" << dendl;
        errors++;
        continue;
       }
index 9fa06355d86112fdecd74149fc60efc8049b6ff1..0a9a58e206ccf80dae8467f3517b63d0b3a664eb 100644 (file)
@@ -1000,10 +1000,11 @@ WRITE_CLASS_ENCODER(object_info_t)
 inline ostream& operator<<(ostream& out, const object_info_t& oi) {
   out << oi.soid << "(" << oi.version
       << " " << oi.last_reqid;
-  if (oi.wrlock_by.tid)
+  if (oi.soid.snap == CEPH_NOSNAP)
     out << " wrlock_by=" << oi.wrlock_by;
-  if (oi.soid.snap != CEPH_NOSNAP)
-    out << " " << oi.snaps << ")";
+  else
+    out << " " << oi.snaps;
+  out << ")";
   return out;
 }