From c5f880443d4b1f2518516084a59a1512a0579034 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 8 Feb 2017 16:58:54 -0500 Subject: [PATCH] osd/osd_types: make set_last_backfill() assume bitwise Signed-off-by: Sage Weil --- src/osd/OSD.cc | 2 +- src/osd/PG.cc | 11 +++++------ src/osd/PrimaryLogPG.cc | 6 +++--- src/osd/osd_types.h | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 43e9be44ac556..f7f2695b368f8 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8415,7 +8415,7 @@ void OSD::handle_pg_query(OpRequestRef op) * before the pg is recreated, we'll just start it off backfilling * instead of just empty */ if (service.deleting_pgs.lookup(pgid)) - empty.set_last_backfill(hobject_t(), true); + empty.set_last_backfill(hobject_t()); if (it->second.type == pg_query_t::LOG || it->second.type == pg_query_t::FULLLOG) { ConnectionRef con = service.get_con_osd_cluster(from, osdmap->get_epoch()); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8757d28c5efb8..54f9fd24ca545 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1701,7 +1701,7 @@ void PG::activate(ObjectStore::Transaction& t, pi.last_update = info.last_update; pi.last_complete = info.last_update; - pi.set_last_backfill(hobject_t(), get_sort_bitwise()); + pi.set_last_backfill(hobject_t()); pi.last_epoch_started = info.last_epoch_started; pi.history = info.history; pi.hit_set = info.hit_set; @@ -2262,15 +2262,14 @@ void PG::split_into(pg_t child_pgid, PG *child, unsigned split_bits) child->info.purged_snaps = info.purged_snaps; if (info.last_backfill.is_max()) { - child->info.set_last_backfill(hobject_t::get_max(), - info.last_backfill_bitwise); + child->info.set_last_backfill(hobject_t::get_max()); } else { // restart backfill on parent and child to be safe. we could // probably do better in the bitwise sort case, but it's more // fragile (there may be special work to do on backfill completion // in the future). - info.set_last_backfill(hobject_t(), info.last_backfill_bitwise); - child->info.set_last_backfill(hobject_t(), info.last_backfill_bitwise); + info.set_last_backfill(hobject_t()); + child->info.set_last_backfill(hobject_t()); } child->info.stats = info.stats; @@ -2921,7 +2920,7 @@ void PG::init( if (backfill) { dout(10) << __func__ << ": Setting backfill" << dendl; - info.set_last_backfill(hobject_t(), get_sort_bitwise()); + info.set_last_backfill(hobject_t()); info.last_complete = info.last_update; pg_log.mark_log_for_rewrite(); } diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 6fb307e3fbaf5..e160709cfb2f6 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3467,7 +3467,7 @@ void PrimaryLogPG::do_backfill(OpRequestRef op) { assert(cct->_conf->osd_kill_backfill_at != 2); - info.set_last_backfill(m->last_backfill, get_sort_bitwise()); + info.set_last_backfill(m->last_backfill); if (m->compat_stat_sum) { info.stats.stats = m->stats.stats; // Previously, we only sent sum } else { @@ -9986,7 +9986,7 @@ void PrimaryLogPG::on_removal(ObjectStore::Transaction *t) dout(10) << "on_removal" << dendl; // adjust info to backfill - info.set_last_backfill(hobject_t(), true); + info.set_last_backfill(hobject_t()); pg_log.reset_backfill(); dirty_info = true; @@ -11216,7 +11216,7 @@ uint64_t PrimaryLogPG::recover_backfill( pg_info_t& pinfo = peer_info[bt]; if (new_last_backfill > pinfo.last_backfill) { - pinfo.set_last_backfill(new_last_backfill, get_sort_bitwise()); + pinfo.set_last_backfill(new_last_backfill); epoch_t e = get_osdmap()->get_epoch(); MOSDPGBackfill *m = NULL; if (pinfo.last_backfill.is_max()) { diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 74f5002284777..318a902856aa0 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -2210,9 +2210,9 @@ struct pg_info_t { last_backfill_bitwise(false) { } - void set_last_backfill(hobject_t pos, bool sort) { + void set_last_backfill(hobject_t pos) { last_backfill = pos; - last_backfill_bitwise = sort; + last_backfill_bitwise = true; } bool is_empty() const { return last_update.version == 0; } -- 2.39.5