]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: reorder pg_num_max
authorKamoltat <ksirivad@redhat.com>
Mon, 28 Feb 2022 21:38:34 +0000 (21:38 +0000)
committerKamoltat <ksirivad@redhat.com>
Fri, 11 Mar 2022 16:43:43 +0000 (16:43 +0000)
moved `pg_num_max` to be at the end of the
list in src/osd/osd_types.cc and
src/osd/osd_types.h.

Added comments to `opt_mapping` and `pool_opts_t`
about the importance of the order of options
in the list and class.

Fixes: https://tracker.ceph.com/issues/54263
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit e44c469f59eaef18ecd3c3b348981939043eae02)

src/osd/osd_types.cc
src/osd/osd_types.h

index 9a0927d16a78de26301081c6b14466b42ba20efd..f1ecd176052b49055936aab6c860602dcd1c205c 100644 (file)
@@ -1316,6 +1316,9 @@ void pool_snap_info_t::generate_test_instances(list<pool_snap_info_t*>& o)
 
 // -- pool_opts_t --
 
+// The order of items in the list is important, therefore,
+// you should always add to the end of the list when adding new options.
+
 typedef std::map<std::string, pool_opts_t::opt_desc_t> opt_mapping_t;
 static opt_mapping_t opt_mapping = boost::assign::map_list_of
           ("scrub_min_interval", pool_opts_t::opt_desc_t(
@@ -1350,8 +1353,6 @@ static opt_mapping_t opt_mapping = boost::assign::map_list_of
             pool_opts_t::FINGERPRINT_ALGORITHM, pool_opts_t::STR))
            ("pg_num_min", pool_opts_t::opt_desc_t(
             pool_opts_t::PG_NUM_MIN, pool_opts_t::INT))
-           ("pg_num_max", pool_opts_t::opt_desc_t(
-            pool_opts_t::PG_NUM_MAX, pool_opts_t::INT))
            ("target_size_bytes", pool_opts_t::opt_desc_t(
             pool_opts_t::TARGET_SIZE_BYTES, pool_opts_t::INT))
            ("target_size_ratio", pool_opts_t::opt_desc_t(
@@ -1365,7 +1366,9 @@ static opt_mapping_t opt_mapping = boost::assign::map_list_of
            ("dedup_chunk_algorithm", pool_opts_t::opt_desc_t(
             pool_opts_t::DEDUP_CHUNK_ALGORITHM, pool_opts_t::STR))
            ("dedup_cdc_chunk_size", pool_opts_t::opt_desc_t(
-            pool_opts_t::DEDUP_CDC_CHUNK_SIZE, pool_opts_t::INT));
+            pool_opts_t::DEDUP_CDC_CHUNK_SIZE, pool_opts_t::INT))
+          ("pg_num_max", pool_opts_t::opt_desc_t(
+             pool_opts_t::PG_NUM_MAX, pool_opts_t::INT));
 
 bool pool_opts_t::is_opt_name(const std::string& name)
 {
index 6fbc56f02f3131005af0cdd120e07ac3ad38d160..2236b7c99d4f34d4e6e36013e1b77501b4ae3454 100644 (file)
@@ -1074,6 +1074,9 @@ inline std::ostream& operator<<(std::ostream& out, const pool_snap_info_t& si) {
  * pool options.
  */
 
+// The order of items in the list is important, therefore,
+// you should always add to the end of the list when adding new options.
+
 class pool_opts_t {
 public:
   enum key_t {
@@ -1093,7 +1096,6 @@ public:
     CSUM_MIN_BLOCK,
     FINGERPRINT_ALGORITHM,
     PG_NUM_MIN,         // min pg_num
-    PG_NUM_MAX,         // max pg_num
     TARGET_SIZE_BYTES,  // total bytes in pool
     TARGET_SIZE_RATIO,  // fraction of total cluster
     PG_AUTOSCALE_BIAS,
@@ -1101,6 +1103,7 @@ public:
     DEDUP_TIER,
     DEDUP_CHUNK_ALGORITHM,
     DEDUP_CDC_CHUNK_SIZE,
+    PG_NUM_MAX, // max pg_num
   };
 
   enum type_t {