]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: record digest if object is clean (vs entire scrub chunk)
authorSage Weil <sage@redhat.com>
Thu, 26 Mar 2015 20:24:11 +0000 (13:24 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 4 Aug 2015 14:39:00 +0000 (07:39 -0700)
If an individual object is clean, record it in the missing_digest map.
If not, leave it out.  This lets us drop the old condition that only
recorded any digests if the entire scrub chunk was clean.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit c39e0e5f126028f552d410ab6924cac6e1f714fb)

src/osd/PGBackend.cc
src/osd/ReplicatedPG.cc

index cb856eb806cd3e0f59dfc2a919c274ef924a097f..535b2a6c878bf5b803cc6eaf15afaabb925aa051 100644 (file)
@@ -581,6 +581,7 @@ void PGBackend::be_compare_scrubmaps(
     ScrubMap::object& auth_object = auth->second->objects[*k];
     set<pg_shard_t> cur_missing;
     set<pg_shard_t> cur_inconsistent;
+    bool clean = true;
     for (j = maps.begin(); j != maps.end(); ++j) {
       if (j == auth)
        continue;
@@ -595,6 +596,7 @@ void PGBackend::be_compare_scrubmaps(
                                   j->second->objects[*k],
                                   ss);
         if (error != CLEAN) {
+         clean = false;
          cur_inconsistent.insert(j->first);
           if (error == SHALLOW_ERROR)
            ++shallow_errors;
@@ -606,6 +608,7 @@ void PGBackend::be_compare_scrubmaps(
          auth_list.push_back(j->first);
        }
       } else {
+       clean = false;
        cur_missing.insert(j->first);
        ++shallow_errors;
        errorstream << __func__ << ": " << pgid << " shard " << j->first
@@ -621,7 +624,8 @@ void PGBackend::be_compare_scrubmaps(
     if (!cur_inconsistent.empty() || !cur_missing.empty()) {
       authoritative[*k] = auth_list;
     }
-    if (okseed &&
+    if (clean &&
+       okseed &&
        parent->get_pool().is_replicated() &&
        auth_object.digest_present && auth_object.omap_digest_present &&
        (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest() ||
index 66fd948b43496aa63ab65975312b13b41f9a5b3a..4da2224233cc9219d1a96e93ac7fd598bfde5f62 100644 (file)
@@ -11382,27 +11382,25 @@ void ReplicatedPG::_scrub(
     ++scrubber.shallow_errors;
   }
 
-  if (scrubber.shallow_errors == 0) {
-    for (map<hobject_t,pair<uint32_t,uint32_t> >::const_iterator p =
-          missing_digest.begin();
-        p != missing_digest.end();
-        ++p) {
-      if (p->first.is_snapdir())
-       continue;
-      dout(10) << __func__ << " recording digests for " << p->first << dendl;
-      ObjectContextRef obc = get_object_context(p->first, false);
-      assert(obc);
-      RepGather *repop = simple_repop_create(obc);
-      OpContext *ctx = repop->ctx;
-      ctx->at_version = get_next_version();
-      ctx->mtime = utime_t();      // do not update mtime
-      ctx->new_obs.oi.set_data_digest(p->second.first);
-      ctx->new_obs.oi.set_omap_digest(p->second.second);
-      finish_ctx(ctx, pg_log_entry_t::MODIFY, true, true);
-      ctx->on_finish = new C_ScrubDigestUpdated(this);
-      simple_repop_submit(repop);
-      ++scrubber.num_digest_updates_pending;
-    }
+  for (map<hobject_t,pair<uint32_t,uint32_t> >::const_iterator p =
+        missing_digest.begin();
+       p != missing_digest.end();
+       ++p) {
+    if (p->first.is_snapdir())
+      continue;
+    dout(10) << __func__ << " recording digests for " << p->first << dendl;
+    ObjectContextRef obc = get_object_context(p->first, false);
+    assert(obc);
+    RepGather *repop = simple_repop_create(obc);
+    OpContext *ctx = repop->ctx;
+    ctx->at_version = get_next_version();
+    ctx->mtime = utime_t();      // do not update mtime
+    ctx->new_obs.oi.set_data_digest(p->second.first);
+    ctx->new_obs.oi.set_omap_digest(p->second.second);
+    finish_ctx(ctx, pg_log_entry_t::MODIFY, true, true);
+    ctx->on_finish = new C_ScrubDigestUpdated(this);
+    simple_repop_submit(repop);
+    ++scrubber.num_digest_updates_pending;
   }
   
   dout(10) << "_scrub (" << mode << ") finish" << dendl;