From: Sage Weil Date: Thu, 4 May 2017 17:20:33 +0000 (-0500) Subject: mon/OSDMonitor: drop allow_pg_upmap option; use require_min_compat_client instead X-Git-Tag: v12.0.3~50^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7c35fd09cde477ad4f0e3787f323e8fe018eafee;p=ceph-ci.git mon/OSDMonitor: drop allow_pg_upmap option; use require_min_compat_client instead Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index adb67b2fc02..6f90a754ef5 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -292,7 +292,6 @@ OPTION(mon_osd_max_op_age, OPT_DOUBLE, 32) // max op age before we get conce OPTION(mon_osd_max_split_count, OPT_INT, 32) // largest number of PGs per "involved" OSD to let split create OPTION(mon_osd_allow_primary_temp, OPT_BOOL, false) // allow primary_temp to be set in the osdmap OPTION(mon_osd_allow_primary_affinity, OPT_BOOL, false) // allow primary_affinity to be set in the osdmap -OPTION(mon_osd_allow_pg_upmap, OPT_BOOL, false) // allow pg upmap to be set in the osdmap OPTION(mon_osd_prime_pg_temp, OPT_BOOL, true) // prime osdmap with pg mapping changes OPTION(mon_osd_prime_pg_temp_max_time, OPT_FLOAT, .5) // max time to spend priming OPTION(mon_osd_prime_pg_temp_max_estimate, OPT_FLOAT, .25) // max estimate of pg total before we do all pgs in parallel diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 288933b4c8f..7c21acd96a1 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7575,13 +7575,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, ss << "set " << pgid << " primary_temp mapping to " << osd; goto update; } else if (prefix == "osd pg-upmap") { - if (!g_conf->mon_osd_allow_pg_upmap) { - ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap. note that pre-luminous clients will no longer be able to communicate with the cluster."; + if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + ss << "you must set the require_luminous_osds flag to use this feature"; err = -EPERM; goto reply; } - if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { - ss << "you must set the require_luminous_osds flag to use this feature"; + if (osdmap.require_min_compat_client < "luminous") { + ss << "min_compat_client " << osdmap.require_min_compat_client + << " < luminous, which is required for pg-upmap"; err = -EPERM; goto reply; } @@ -7636,13 +7637,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, ss << "set " << pgid << " pg_upmap mapping to " << new_pg_upmap; goto update; } else if (prefix == "osd rm-pg-upmap") { - if (!g_conf->mon_osd_allow_pg_upmap) { - ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap. note that pre-luminous clients will no longer be able to communicate with the cluster."; + if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + ss << "you must set the require_luminous_osds flag to use this feature"; err = -EPERM; goto reply; } - if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { - ss << "you must set the require_luminous_osds flag to use this feature"; + if (osdmap.require_min_compat_client < "luminous") { + ss << "require_min_compat_client " << osdmap.require_min_compat_client + << " < luminous, which is required for pg-upmap"; err = -EPERM; goto reply; } @@ -7680,13 +7682,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, ss << "clear " << pgid << " pg_upmap mapping"; goto update; } else if (prefix == "osd pg-upmap-items") { - if (!g_conf->mon_osd_allow_pg_upmap) { - ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap. note that pre-luminous clients will no longer be able to communicate with the cluster."; + if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + ss << "you must set the require_luminous_osds flag to use this feature"; err = -EPERM; goto reply; } - if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { - ss << "you must set the require_luminous_osds flag to use this feature"; + if (osdmap.require_min_compat_client < "luminous") { + ss << "require_min_compat_client " << osdmap.require_min_compat_client + << " < luminous, which is required for pg-upmap"; err = -EPERM; goto reply; } @@ -7754,13 +7757,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, ss << "set " << pgid << " pg_upmap_items mapping to " << new_pg_upmap_items; goto update; } else if (prefix == "osd rm-pg-upmap-items") { - if (!g_conf->mon_osd_allow_pg_upmap) { - ss << "you must enable 'mon osd allow pg upmap = true' on the mons before you can adjust pg_upmap. note that pre-luminous clients will no longer be able to communicate with the cluster."; + if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + ss << "you must set the require_luminous_osds flag to use this feature"; err = -EPERM; goto reply; } - if (!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { - ss << "you must set the require_luminous_osds flag to use this feature"; + if (osdmap.require_min_compat_client < "luminous") { + ss << "require_min_compat_client " << osdmap.require_min_compat_client + << " < luminous, which is required for pg-upmap"; err = -EPERM; goto reply; }