Skip to content

Commit d706cec

Browse files
committed
osd: no 'legacy' form for two configuration options
also - fixing review comments not addressed in the original PR. Signed-off-by: Ronen Friedman <[email protected]>
1 parent d828847 commit d706cec

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/common/options/global.yaml.in

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,18 +2918,16 @@ options:
29182918
- name: osd_pg_stat_report_interval_max_seconds
29192919
type: int
29202920
level: advanced
2921-
desc: The maximum interval seconds for update pg's reported_epoch,
2922-
benefit for osdmap trim when osdmap not change frequently.
2923-
with_legacy: true
2921+
desc: How often (in seconds) should PGs stats be collected.
2922+
with_legacy: false
29242923
default: 5
29252924
- name: osd_pg_stat_report_interval_max_epochs
29262925
type: int
29272926
level: advanced
2928-
desc: The maximum interval by which pg's reported_epoch lags behind,
2929-
otherwise, pg's reported_epoch must be updated,
2930-
benefit for osdmap trim when osdmap changes frequently.
2927+
desc: The maximum number of epochs allowed to pass before PG stats
2928+
are collected.
29312929
default: 500
2932-
with_legacy: true
2930+
with_legacy: false
29332931
# Max number of snap intervals to report to mgr in pg_stat_t
29342932
- name: osd_max_snap_prune_intervals_per_epoch
29352933
type: uint

src/osd/PeeringState.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3909,16 +3909,18 @@ std::optional<pg_stat_t> PeeringState::prepare_stats_for_publish(
39093909
// when there is no change in osdmap,
39103910
// update info.stats.reported_epoch by the number of time seconds.
39113911
utime_t cutoff_time = now;
3912-
cutoff_time -= cct->_conf->osd_pg_stat_report_interval_max_seconds;
3913-
bool is_time_expired = cutoff_time > info.stats.last_fresh ? true : false;
3912+
cutoff_time -=
3913+
cct->_conf.get_val<int64_t>("osd_pg_stat_report_interval_max_seconds");
3914+
const bool is_time_expired = cutoff_time > info.stats.last_fresh;
39143915

39153916
// 500 epoch osdmaps are also the minimum number of osdmaps that mon must retain.
39163917
// if info.stats.reported_epoch less than current osdmap epoch exceeds 500 osdmaps,
39173918
// it can be considered that the one reported by pgid is too old and needs to be updated.
39183919
// to facilitate mon trim osdmaps
39193920
epoch_t cutoff_epoch = info.stats.reported_epoch;
3920-
cutoff_epoch += cct->_conf->osd_pg_stat_report_interval_max_epochs;
3921-
bool is_epoch_behind = cutoff_epoch < get_osdmap_epoch() ? true : false;
3921+
cutoff_epoch +=
3922+
cct->_conf.get_val<int64_t>("osd_pg_stat_report_interval_max_epochs");
3923+
const bool is_epoch_behind = cutoff_epoch < get_osdmap_epoch();
39223924

39233925
if (pg_stats_publish && pre_publish == *pg_stats_publish &&
39243926
(!is_epoch_behind && !is_time_expired)) {

0 commit comments

Comments
 (0)