diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 4bd1329589e64..8959684cd9961 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -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. + diff --git a/src/common/config_opts.h b/src/common/config_opts.h index a6227e9a56a0e..516142b224bd7 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index bc12f78356948..0dde567091eca 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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;