Skip to content

Commit

Permalink
common/config: change type of osd_mon_ack_timeout from int to double
Browse files Browse the repository at this point in the history
We may use osd_mon_ack_timeout the following way:
  double backoff = stats_ack_timeout / g_conf->osd_mon_ack_timeout;
which is at risk of precision lost.

Example:

main()
{
  double r = 5 / 30;
  cout << "r = " << r << std::endl;
}

Output:
  r = 0

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information
xiexingguo committed Aug 1, 2016
1 parent 3cde80c commit 60ff0ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ OPTION(osd_mon_report_interval_max, OPT_INT, 600)
OPTION(osd_mon_report_interval_min, OPT_INT, 5) // pg stats, failures, up_thru, boot.
OPTION(osd_mon_report_max_in_flight, OPT_INT, 2) // max updates in flight
OPTION(osd_pg_stat_report_interval_max, OPT_INT, 500) // report pg stats for any given pg at least this often
OPTION(osd_mon_ack_timeout, OPT_INT, 30) // time out a mon if it doesn't ack stats
OPTION(osd_mon_ack_timeout, OPT_DOUBLE, 30.0) // time out a mon if it doesn't ack stats
OPTION(osd_stats_ack_timeout_factor, OPT_DOUBLE, 2.0) // multiples of mon_ack_timeout
OPTION(osd_stats_ack_timeout_decay, OPT_DOUBLE, .9)
OPTION(osd_default_data_pool_replay_window, OPT_INT, 45)
Expand Down

0 comments on commit 60ff0ec

Please sign in to comment.