]> 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>
Wed, 23 Mar 2022 14:11:21 +0000 (14:11 +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 62a4a4d3dd5fa93b39465760723450efca240cbd..f74082f2523e0c60f444b727cd35d8f5aab66b2b 100644 (file)
@@ -1312,6 +1312,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(
@@ -1346,8 +1349,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(
@@ -1361,7 +1362,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 6b1f32569557cd9dfc2f10cb511403ba85153c8e..93645c5f218c706155c25155da2f593b105480fe 100644 (file)
@@ -1039,6 +1039,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 {
@@ -1058,7 +1061,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,
@@ -1066,6 +1068,7 @@ public:
     DEDUP_TIER,
     DEDUP_CHUNK_ALGORITHM,
     DEDUP_CDC_CHUNK_SIZE,
+    PG_NUM_MAX, // max pg_num
   };
 
   enum type_t {