PG: clarify same_primary_since updates regarding primary rank

pg_shard_t includes the position, so these checks handle
same osd/different rank properly.

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2014-02-23 13:29:07 -08:00
parent 8913ab4bb5
commit d0359f7c1c

View 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();
}