]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PGBackend: do not update oi digest on inconsistent object
authorSamuel Just <sjust@redhat.com>
Mon, 19 Jan 2015 20:08:42 +0000 (12:08 -0800)
committerSamuel Just <sjust@redhat.com>
Mon, 19 Jan 2015 20:08:42 +0000 (12:08 -0800)
Otherwise, repair can race with the oi update.  Also, it doesn't really
make sense to update the oi attr if the object is inconsistent.

Fixes: #10524
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PGBackend.cc

index cc5da8fafcda43d1d4a6c7cc1b7fb384007c22fc..5ff7edc25dc4203deb4a812e13a4fbfdc9fd724b 100644 (file)
@@ -624,15 +624,20 @@ void PGBackend::be_compare_scrubmaps(
     if (okseed &&
        auth_object.digest_present && auth_object.omap_digest_present &&
        (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest())) {
-      utime_t age = now - auth_oi.local_mtime;
-      if (age > g_conf->osd_deep_scrub_update_digest_min_age) {
-       dout(20) << __func__ << " noting missing digest on " << *k << dendl;
-       missing_digest[*k] = make_pair(auth_object.digest,
-                                      auth_object.omap_digest);
+      if (!cur_inconsistent.empty() || !cur_missing.empty()) {
+       dout(20) << __func__ << " not updating oi digest on "
+                << *k << " since it is inconsistent" << dendl;
       } else {
-       dout(20) << __func__ << " missing digest but age " << age
-                << " < " << g_conf->osd_deep_scrub_update_digest_min_age
-                << " on " << *k << dendl;
+       utime_t age = now - auth_oi.local_mtime;
+       if (age > g_conf->osd_deep_scrub_update_digest_min_age) {
+         dout(20) << __func__ << " noting missing digest on " << *k << dendl;
+         missing_digest[*k] = make_pair(auth_object.digest,
+                                        auth_object.omap_digest);
+       } else {
+         dout(20) << __func__ << " missing digest but age " << age
+                  << " < " << g_conf->osd_deep_scrub_update_digest_min_age
+                  << " on " << *k << dendl;
+       }
       }
     }
   }