]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ECTransaction: require hash_infos for deleted objects
authorSamuel Just <sam.just@inktank.com>
Fri, 21 Feb 2014 17:34:15 +0000 (09:34 -0800)
committerSamuel Just <sam.just@inktank.com>
Sat, 22 Feb 2014 20:35:40 +0000 (12:35 -0800)
Otherwise, an append preceded by a delete may not see the
correct HashInfo state since it won't have been cached
until the delete is applied.

Fixes: #7506
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ECTransaction.cc

index 7e345f380ddc193eea7e2fec8fd49624992536ad..3e725f6d775160de7d2a50e22ce1cb476c647586 100644 (file)
@@ -38,8 +38,12 @@ struct AppendObjectsGenerator: public boost::static_visitor<void> {
     out->insert(op.source);
     out->insert(op.destination);
   }
-  void operator()(const ECTransaction::StashOp &op) {}
-  void operator()(const ECTransaction::RemoveOp &op) {}
+  void operator()(const ECTransaction::StashOp &op) {
+    out->insert(op.oid);
+  }
+  void operator()(const ECTransaction::RemoveOp &op) {
+    out->insert(op.oid);
+  }
   void operator()(const ECTransaction::SetAttrsOp &op) {}
   void operator()(const ECTransaction::RmAttrOp &op) {}
   void operator()(const ECTransaction::NoOp &op) {}
@@ -189,8 +193,8 @@ struct TransGenerator : public boost::static_visitor<void> {
     }
   }
   void operator()(const ECTransaction::StashOp &op) {
-    if (hash_infos.count(op.oid))
-      hash_infos[op.oid]->clear();
+    assert(hash_infos.count(op.oid));
+    hash_infos[op.oid]->clear();
     for (map<shard_id_t, ObjectStore::Transaction>::iterator i = trans->begin();
         i != trans->end();
         ++i) {
@@ -203,8 +207,8 @@ struct TransGenerator : public boost::static_visitor<void> {
     }
   }
   void operator()(const ECTransaction::RemoveOp &op) {
-    if (hash_infos.count(op.oid))
-      hash_infos[op.oid]->clear();
+    assert(hash_infos.count(op.oid));
+    hash_infos[op.oid]->clear();
     for (map<shard_id_t, ObjectStore::Transaction>::iterator i = trans->begin();
         i != trans->end();
         ++i) {