From d4f9edceda89c9096b228cb3ef1581a2e20fe044 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 13 Jun 2020 15:41:04 +0800 Subject: [PATCH] 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 --- src/osd/PeeringState.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.39.5