]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: clarify same_primary_since updates regarding primary rank
authorSamuel Just <sam.just@inktank.com>
Sun, 23 Feb 2014 21:29:07 +0000 (13:29 -0800)
committerSamuel Just <sam.just@inktank.com>
Sun, 23 Feb 2014 21:35:16 +0000 (13:35 -0800)
pg_shard_t includes the position, so these checks handle
same osd/different rank properly.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index b7338bfb9ee2dcdf99bd46e4f2f56ebec77a04f3..164dc3ad4240f4c1a87cdaacb10e925586b904bf 100644 (file)
@@ -2054,6 +2054,8 @@ void PG::split_into(pg_t child_pgid, PG *child, unsigned split_bits)
     up_primary,
     primary);
   child->role = OSDMap::calc_pg_role(osd->whoami, child->acting);
+
+  // this comparison includes primary rank via pg_shard_t
   if (get_primary() != child->get_primary())
     child->info.history.same_primary_since = get_osdmap()->get_epoch();
 
@@ -4705,6 +4707,7 @@ void PG::start_peering_interval(
       oldup != up) {
     info.history.same_up_since = osdmap->get_epoch();
   }
+  // this comparison includes primary rank via pg_shard_t
   if (old_acting_primary != get_primary()) {
     info.history.same_primary_since = osdmap->get_epoch();
   }