]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PeeringState: fix info.stats.up[acting] of splitting child 35559/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 13 Jun 2020 07:41:04 +0000 (15:41 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 13 Jun 2020 07:41:04 +0000 (15:41 +0800)
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>
src/osd/PeeringState.cc

index ac42d9c281851ddeeb2ee8ca1bfe8dc35252bede..03ada292d2465862a90d5077c015d4c8dd838f78 100644 (file)
@@ -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();