From: xie xingguo Date: Sat, 13 Jun 2020 07:41:04 +0000 (+0800) Subject: osd/PeeringState: fix info.stats.up[acting] of splitting child X-Git-Tag: v16.1.0~2039^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F35559%2Fhead;p=ceph.git osd/PeeringState: fix info.stats.up[acting] of splitting child 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 --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index ac42d9c2818..03ada292d24 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2949,9 +2949,9 @@ void PeeringState::split_into( 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();