]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: change osd_crush_initial_weight = 0 to mean weight to 0
authorSage Weil <sage@redhat.com>
Fri, 22 Apr 2016 15:12:38 +0000 (11:12 -0400)
committerSage Weil <sage@redhat.com>
Mon, 9 May 2016 12:55:00 +0000 (08:55 -0400)
Negative now means auto-weight, 0 means weight to 0.  Change the
default accordingly.

Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes
src/common/config_opts.h
src/osd/OSD.cc

index 4bd1329589e64bdd26d57dce76b3b1567f788a1a..8959684cd9961695a04febc8a6189e6ee6b7f087 100644 (file)
   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.
+
index a6227e9a56a0e07cec5c3cf8013d066138e70cb2..516142b224bd765f418ddd2a43d52b500674a1e8 100644 (file)
@@ -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
index bc12f78356948bbfd33aeb36b5341d397b636aa5..0dde567091ecade737bf2776b0a53e0012181de5 100644 (file)
@@ -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;