Skip to content

Commit

Permalink
osd: change osd_crush_initial_weight = 0 to mean weight to 0
Browse files Browse the repository at this point in the history
Negative now means auto-weight, 0 means weight to 0.  Change the
default accordingly.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed May 9, 2016
1 parent 573c349 commit cf4ec5a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions PendingReleaseNotes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@
New monitors will now use rocksdb by default, but if that file is
not present, existing monitors will use leveldb. The ``mon keyvaluedb`` option
now only affects the backend chosen when a monitor is created.

* The 'osd crush initial weight' option allows you to specify a CRUSH
weight for a newly added OSD. Previously a value of 0 (the default)
meant that we should use the size of the OSD's store to weight the
new OSD. Now, a value of 0 means it should have a weight of 0, and
a negative value (the new default) means we should automatically
weight the OSD based on its size. If your configuration file
explicitly specifies a value of 0 for this option you will need to
change it to a negative value (e.g., -1) to preserve the current
behavior.

2 changes: 1 addition & 1 deletion src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ OPTION(osd_pgp_bits, OPT_INT, 6) // bits per osd
OPTION(osd_crush_chooseleaf_type, OPT_INT, 1) // 1 = host
OPTION(osd_pool_use_gmt_hitset, OPT_BOOL, true) // try to use gmt for hitset archive names if all osds in cluster support it.
OPTION(osd_crush_update_on_start, OPT_BOOL, true)
OPTION(osd_crush_initial_weight, OPT_DOUBLE, 0) // the initial weight is for newly added osds.
OPTION(osd_crush_initial_weight, OPT_DOUBLE, -1) // if >=0, the initial weight is for newly added osds.
OPTION(osd_pool_default_crush_rule, OPT_INT, -1) // deprecated for osd_pool_default_crush_replicated_ruleset
OPTION(osd_pool_default_crush_replicated_ruleset, OPT_INT, CEPH_DEFAULT_CRUSH_REPLICATED_RULESET)
OPTION(osd_pool_erasure_code_stripe_width, OPT_U32, OSD_POOL_ERASURE_CODE_STRIPE_WIDTH) // in bytes
Expand Down
2 changes: 1 addition & 1 deletion src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ int OSD::update_crush_location()
}

char weight[32];
if (g_conf->osd_crush_initial_weight) {
if (g_conf->osd_crush_initial_weight >= 0) {
snprintf(weight, sizeof(weight), "%.4lf", g_conf->osd_crush_initial_weight);
} else {
struct statfs st;
Expand Down

0 comments on commit cf4ec5a

Please sign in to comment.