From: Josh Durgin Date: Fri, 2 Feb 2018 23:47:11 +0000 (-0800) Subject: Merge pull request #20098 from ovh/bp-luminous-snaptrimq-visibility X-Git-Tag: v12.2.3~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=982bd2386543be41eb3d67f9207971d285b08807;p=ceph.git Merge pull request #20098 from ovh/bp-luminous-snaptrimq-visibility luminous: osd, pg, mgr: make snap trim queue problems visible Reviewed-by: Josh Durgin --- 982bd2386543be41eb3d67f9207971d285b08807 diff --cc src/osd/PG.cc index 968d457cc55c,255e0d375155..85f402df7473 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@@ -2579,15 -2566,20 +2579,16 @@@ void PG::_update_calc_stats( info.stats.ondisk_log_size = info.stats.log_size; info.stats.log_start = pg_log.get_tail(); info.stats.ondisk_log_start = pg_log.get_tail(); + info.stats.snaptrimq_len = snap_trimq.size(); - // If actingset is larger then upset we will have misplaced, - // so we will report based on actingset size. - - // If upset is larger then we will have degraded, - // so we will report based on upset size. + unsigned num_shards = get_osdmap()->get_pg_size(info.pgid.pgid); - // If target is the largest of them all, it will contribute to - // the degraded count because num_object_copies is - // computed using target and eventual used to get degraded total. - - unsigned target = get_osdmap()->get_pg_size(info.pgid.pgid); - unsigned nrep = MAX(actingset.size(), upset.size()); + // In rare case that upset is too large (usually transient), use as target + // for calculations below. + unsigned target = std::max(num_shards, (unsigned)upset.size()); + // Not sure this could ever happen, that actingset > upset + // which only matters if actingset > num_shards. + unsigned nrep = std::max(actingset.size(), upset.size()); // calc num_object_copies info.stats.stats.calc_copies(MAX(target, nrep)); info.stats.stats.sum.num_objects_degraded = 0;