]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use accessor to set last_backfill
authorSage Weil <sage@redhat.com>
Fri, 17 Jul 2015 18:15:55 +0000 (14:15 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:02 +0000 (10:16 -0400)
Always will in last_backfill and last_backfill_bitwise together.

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

index 4bc978e8bcc753523b126a03eed4210127b8df59..8fc2bd10f775f6b1eee316f2e26bb322524714b6 100644 (file)
@@ -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());
index 2fec729d26f567eeef0810144e04d8faed7f4f8c..7696c4ef36a24ede25c1e528bab9dcd195455846 100644 (file)
@@ -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();
   }
index 5a91c48c4011900c37d618a83dc7c5282668ccb1..33832aa8043e889bb82afa5f9b934f0389861982 100644 (file)
@@ -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()) {
index 481e014774805def4d492e1628c2a8009614a4ff..ae2a80444916af4f87b1ad039ed2528e5a32119f 100644 (file)
@@ -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; }