]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: do not trust last_backfill for purposes of missing objects if sort order...
authorSage Weil <sage@redhat.com>
Fri, 17 Jul 2015 18:43:53 +0000 (14:43 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:02 +0000 (10:16 -0400)
If the peer has the wrong sort order, we cannot trust lsst_backfill and we
do not know if the object is there.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index ca6ce719ebf086487cd66319dd786fd3c638e889..628bd130023ab7107ca1ddb2a0a9c9bef268ba23 100644 (file)
@@ -422,7 +422,7 @@ bool PG::search_for_missing(
 {
   unsigned num_unfound_before = missing_loc.num_unfound();
   bool found_missing = missing_loc.add_source_info(
-    from, oinfo, omissing, ctx->handle);
+    from, oinfo, omissing, get_sort_bitwise(), ctx->handle);
   if (found_missing && num_unfound_before != missing_loc.num_unfound())
     publish_stats_to_osd();
   if (found_missing &&
@@ -475,6 +475,7 @@ bool PG::MissingLoc::add_source_info(
   pg_shard_t fromosd,
   const pg_info_t &oinfo,
   const pg_missing_t &omissing,
+  bool sort_bitwise,
   ThreadPool::TPHandle* handle)
 {
   bool found_missing = false;
@@ -494,6 +495,15 @@ bool PG::MissingLoc::add_source_info(
               << dendl;
       continue;
     }
+    if (oinfo.last_backfill != hobject_t::get_max() &&
+       oinfo.last_backfill_bitwise != sort_bitwise) {
+      dout(10) << "search_for_missing " << soid << " " << need
+              << " also missing on osd." << fromosd
+              << " (last_backfill " << oinfo.last_backfill
+              << " but with wrong sort order)"
+              << dendl;
+      continue;
+    }
     if (p->first >= oinfo.last_backfill) {
       // FIXME: this is _probably_ true, although it could conceivably
       // be in the undefined region!  Hmm!
@@ -1735,7 +1745,8 @@ void PG::activate(ObjectStore::Transaction& t,
       if (complete_shards.size() + 1 == actingbackfill.size()) {
         missing_loc.add_batch_sources_info(complete_shards);
       } else {
-        missing_loc.add_source_info(pg_whoami, info, pg_log.get_missing(), ctx->handle);
+        missing_loc.add_source_info(pg_whoami, info, pg_log.get_missing(),
+                                   get_sort_bitwise(), ctx->handle);
         for (set<pg_shard_t>::iterator i = actingbackfill.begin();
             i != actingbackfill.end();
             ++i) {
@@ -1747,6 +1758,7 @@ void PG::activate(ObjectStore::Transaction& t,
            *i,
            peer_info[*i],
            peer_missing[*i],
+           get_sort_bitwise(),
             ctx->handle);
         }
       }
index 396221e5cddcd4deff9e4302fe87c97f6001f045..6789872aaa8a63b061069197e816653bd2f72472 100644 (file)
@@ -400,6 +400,7 @@ public:
       pg_shard_t source,           ///< [in] source
       const pg_info_t &oinfo,      ///< [in] info
       const pg_missing_t &omissing, ///< [in] (optional) missing
+      bool sort_bitwise,            ///< [in] local sort bitwise (vs nibblewise)
       ThreadPool::TPHandle* handle  ///< [in] ThreadPool handle
       ); ///< @return whether a new object location was discovered