]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: correct the checking if the promoting object is in other 4111/head
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 20 Mar 2015 02:45:34 +0000 (10:45 +0800)
committerZhiqiang Wang <zhiqiang.wang@intel.com>
Fri, 20 Mar 2015 02:45:34 +0000 (10:45 +0800)
hit sets

missing_oid could be a NULL object while obc is not. Should check
obc->obs.oi.soid first, and then missing_oid.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/osd/ReplicatedPG.cc

index 3d8ed84b4b95d213ed1035bf20bcc3f824e6d545..5482f6787dac3301a699dd1b3a9f49e80a8af519 100644 (file)
@@ -1945,10 +1945,17 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
        map<time_t,HitSetRef>::iterator itor;
        bool in_other_hit_sets = false;
        for (itor = agent_state->hit_set_map.begin(); itor != agent_state->hit_set_map.end(); ++itor) {
-         if (itor->second->contains(missing_oid)) {
-           in_other_hit_sets = true;
-           break;
-         }
+          if (obc.get()) {
+            if (obc->obs.oi.soid != hobject_t() && itor->second->contains(obc->obs.oi.soid)) {
+              in_other_hit_sets = true;
+              break;
+            }
+          } else {
+            if (missing_oid != hobject_t() && itor->second->contains(missing_oid)) {
+              in_other_hit_sets = true;
+              break;
+            }
+          }
        }
        if (in_other_hit_sets) {
          promote_object(obc, missing_oid, oloc, promote_op);