In general a splitting child should have the same CRUSH
mapping result with its parent at the initialization stage.
However, since luminous mgr/balancer may change existing PGs'
original CRUSH mappings by explictly generating some
pg_upmap_items and feeding them to pg_to_up_acting_osds(),
hence the inconsistency of 'ceph pg ls' command output, i.e.,
because child is now reporting its parent's up set ([2,4,3])
rather than its own ([1,4,3]), which are actually different:
1.3a active+clean 2020-05-21 16:16:33.011237 0'0 34:26 [2,4,3] 1 [2,4,3] 1
Fix by using child's own CRUSH mappings when filling in
the corresponding fields of info.stats (We already have that
kind of info in hand and it is accurate under all circumstances).
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
if (get_primary() != child->get_primary())
child->info.history.same_primary_since = get_osdmap_epoch();
- child->info.stats.up = up;
+ child->info.stats.up = newup;
child->info.stats.up_primary = up_primary;
- child->info.stats.acting = acting;
+ child->info.stats.acting = newacting;
child->info.stats.acting_primary = primary;
child->info.stats.mapping_epoch = get_osdmap_epoch();