From: Sage Weil Date: Fri, 17 Jul 2015 18:15:55 +0000 (-0400) Subject: osd: use accessor to set last_backfill X-Git-Tag: v9.1.0~346^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8230375b5b34da7d9ee93e9150b2bbc877a53687;p=ceph.git osd: use accessor to set last_backfill Always will in last_backfill and last_backfill_bitwise together. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 4bc978e8bcc..8fc2bd10f77 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -7592,7 +7592,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.last_backfill = hobject_t(); + empty.set_last_backfill(hobject_t(), true); 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 2fec729d26f..7696c4ef36a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1641,7 +1641,7 @@ void PG::activate(ObjectStore::Transaction& t, pi.last_update = info.last_update; pi.last_complete = info.last_update; - pi.last_backfill = hobject_t(); + pi.set_last_backfill(hobject_t(), get_sort_bitwise()); pi.last_epoch_started = info.last_epoch_started; pi.history = info.history; pi.hit_set = info.hit_set; @@ -2196,7 +2196,7 @@ void PG::split_into(pg_t child_pgid, PG *child, unsigned split_bits) // Info child->info.history = info.history; child->info.purged_snaps = info.purged_snaps; - child->info.last_backfill = info.last_backfill; + child->info.set_last_backfill(info.last_backfill, info.last_backfill_bitwise); child->info.stats = info.stats; info.stats.stats_invalid = true; @@ -2590,7 +2590,7 @@ void PG::init( if (backfill) { dout(10) << __func__ << ": Setting backfill" << dendl; - info.last_backfill = hobject_t(); + info.set_last_backfill(hobject_t(), get_sort_bitwise()); info.last_complete = info.last_update; pg_log.mark_log_for_rewrite(); } diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 5a91c48c401..33832aa8043 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2641,7 +2641,7 @@ void ReplicatedPG::do_backfill(OpRequestRef op) { assert(cct->_conf->osd_kill_backfill_at != 2); - info.last_backfill = m->last_backfill; + info.set_last_backfill(m->last_backfill, get_sort_bitwise()); if (m->compat_stat_sum) { info.stats.stats = m->stats.stats; // Previously, we only sent sum } else { @@ -8777,7 +8777,7 @@ void ReplicatedPG::on_removal(ObjectStore::Transaction *t) dout(10) << "on_removal" << dendl; // adjust info to backfill - info.last_backfill = hobject_t(); + info.set_last_backfill(hobject_t(), true); dirty_info = true; @@ -9934,7 +9934,7 @@ int ReplicatedPG::recover_backfill( pg_info_t& pinfo = peer_info[bt]; if (new_last_backfill > pinfo.last_backfill) { - pinfo.last_backfill = new_last_backfill; + pinfo.set_last_backfill(new_last_backfill, get_sort_bitwise()); 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 481e0147748..ae2a8044491 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1856,6 +1856,11 @@ struct pg_info_t { last_backfill_bitwise(false) { } + void set_last_backfill(hobject_t pos, bool sort) { + last_backfill = pos; + last_backfill_bitwise = sort; + } + bool is_empty() const { return last_update.version == 0; } bool dne() const { return history.epoch_created == 0; }