From: Sage Weil Date: Fri, 17 Jul 2015 18:43:53 +0000 (-0400) Subject: osd/PG: do not trust last_backfill for purposes of missing objects if sort order... X-Git-Tag: v9.1.0~346^2~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a36cae1a1d773c79f0e9a5895760fb934c32b0b8;p=ceph.git osd/PG: do not trust last_backfill for purposes of missing objects if sort order is wrong 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 --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ca6ce719ebf0..628bd130023a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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::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); } } diff --git a/src/osd/PG.h b/src/osd/PG.h index 396221e5cddc..6789872aaa8a 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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