]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: no 'legacy' form for two configuration options 55478/head
authorRonen Friedman <rfriedma@redhat.com>
Wed, 7 Feb 2024 13:40:32 +0000 (07:40 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Fri, 9 Feb 2024 10:14:10 +0000 (04:14 -0600)
also - fixing review comments not addressed in the original PR.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/common/options/global.yaml.in
src/osd/PeeringState.cc

index feb9aeb7b5e597938a532cf63a697fd84a3c2a85..ead0d0caedd3398be843621210feebef80466766 100644 (file)
@@ -2918,18 +2918,16 @@ options:
 - name: osd_pg_stat_report_interval_max_seconds
   type: int
   level: advanced
-  desc: The maximum interval seconds for update pg's reported_epoch,
-        benefit for osdmap trim when osdmap not change frequently.
-  with_legacy: true
+  desc: How often (in seconds) should PGs stats be collected.
+  with_legacy: false
   default: 5
 - name: osd_pg_stat_report_interval_max_epochs
   type: int
   level: advanced
-  desc: The maximum interval by which pg's reported_epoch lags behind,
-        otherwise, pg's reported_epoch must be updated,
-        benefit for osdmap trim when osdmap changes frequently.
+  desc: The maximum number of epochs allowed to pass before PG stats
+        are collected.
   default: 500
-  with_legacy: true
+  with_legacy: false
 # Max number of snap intervals to report to mgr in pg_stat_t
 - name: osd_max_snap_prune_intervals_per_epoch
   type: uint
index 4da75b2385da99e3abb1450403f92516c29bbbb0..38ff7722b8b24e5fac73c2fb21c9037b8093691b 100644 (file)
@@ -3909,16 +3909,18 @@ std::optional<pg_stat_t> PeeringState::prepare_stats_for_publish(
   // when there is no change in osdmap,
   // update info.stats.reported_epoch by the number of time seconds.
   utime_t cutoff_time = now;
-  cutoff_time -= cct->_conf->osd_pg_stat_report_interval_max_seconds;
-  bool is_time_expired = cutoff_time > info.stats.last_fresh ? true : false;
+  cutoff_time -=
+      cct->_conf.get_val<int64_t>("osd_pg_stat_report_interval_max_seconds");
+  const bool is_time_expired = cutoff_time > info.stats.last_fresh;
 
   // 500 epoch osdmaps are also the minimum number of osdmaps that mon must retain.
   // if info.stats.reported_epoch less than current osdmap epoch exceeds 500 osdmaps,
   // it can be considered that the one reported by pgid is too old and needs to be updated.
   // to facilitate mon trim osdmaps
   epoch_t cutoff_epoch = info.stats.reported_epoch;
-  cutoff_epoch += cct->_conf->osd_pg_stat_report_interval_max_epochs;
-  bool is_epoch_behind = cutoff_epoch < get_osdmap_epoch() ? true : false;
+  cutoff_epoch +=
+      cct->_conf.get_val<int64_t>("osd_pg_stat_report_interval_max_epochs");
+  const bool is_epoch_behind = cutoff_epoch < get_osdmap_epoch();
 
   if (pg_stats_publish && pre_publish == *pg_stats_publish &&
       (!is_epoch_behind && !is_time_expired)) {