]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: switch some osd settings to TYPE_SIZE
authorKefu Chai <kchai@redhat.com>
Tue, 13 Feb 2018 08:02:31 +0000 (16:02 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 9 Mar 2018 05:01:05 +0000 (13:01 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.cc
src/mon/OSDMonitor.cc
src/test/erasure-code/TestErasureCodeLrc.cc

index 4e079cc76e42c649516f528579383493374f4a1e..8fa372391aa907e095c4f0ceabe94102b264d567 100644 (file)
@@ -1914,7 +1914,7 @@ std::vector<Option> get_global_options() {
     .set_default(-1)
     .set_description(""),
 
-    Option("osd_pool_erasure_code_stripe_unit", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("osd_pool_erasure_code_stripe_unit", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(4_K)
     .set_description("the amount of data (in bytes) in a data chunk, per stripe")
     .add_service("mon"),
@@ -2036,7 +2036,7 @@ std::vector<Option> get_global_options() {
     .set_default(25)
     .set_description(""),
 
-    Option("osd_tier_promote_max_bytes_sec", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("osd_tier_promote_max_bytes_sec", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(5_M)
     .set_description(""),
 
@@ -2939,7 +2939,7 @@ std::vector<Option> get_global_options() {
     .set_long_description("This prevents a deep scrub 'stampede' by randomly varying the scrub intervals so that they are soon uniformly distributed over the week")
     .add_see_also("osd_deep_scrub_interval"),
 
-    Option("osd_deep_scrub_stride", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("osd_deep_scrub_stride", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(512_K)
     .set_description("Number of bytes to read from an object at a time during deep scrub"),
 
@@ -2957,7 +2957,7 @@ std::vector<Option> get_global_options() {
     .add_service("osd")
     .add_see_also("osd_deep_scrub_large_omap_object_value_sum_threshold"),
 
-    Option("osd_deep_scrub_large_omap_object_value_sum_threshold", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("osd_deep_scrub_large_omap_object_value_sum_threshold", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(1_G)
     .set_description("Warn when we encounter an object with more omap key bytes than this")
     .add_service("osd")
@@ -3441,7 +3441,7 @@ std::vector<Option> get_global_options() {
     .set_default(131072)
     .set_description(""),
 
-    Option("osd_max_omap_bytes_per_request", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("osd_max_omap_bytes_per_request", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(1_G)
     .set_description(""),
 
@@ -3486,7 +3486,7 @@ std::vector<Option> get_global_options() {
     .set_default(true)
     .set_description(""),
 
-    Option("memstore_device_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("memstore_device_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(1_G)
     .set_description(""),
 
@@ -3843,15 +3843,15 @@ std::vector<Option> get_global_options() {
     .set_description("Compression ratio required to store compressed data")
     .set_long_description("If we compress data and get less than this we discard the result and store the original uncompressed data."),
 
-    Option("bluestore_extent_map_shard_max_size", Option::TYPE_UINT, Option::LEVEL_DEV)
+    Option("bluestore_extent_map_shard_max_size", Option::TYPE_SIZE, Option::LEVEL_DEV)
     .set_default(1200)
     .set_description("Max size (bytes) for a single extent map shard before splitting"),
 
-    Option("bluestore_extent_map_shard_target_size", Option::TYPE_UINT, Option::LEVEL_DEV)
+    Option("bluestore_extent_map_shard_target_size", Option::TYPE_SIZE, Option::LEVEL_DEV)
     .set_default(500)
     .set_description("Target size (bytes) for a single extent map shard"),
 
-    Option("bluestore_extent_map_shard_min_size", Option::TYPE_UINT, Option::LEVEL_DEV)
+    Option("bluestore_extent_map_shard_min_size", Option::TYPE_SIZE, Option::LEVEL_DEV)
     .set_default(150)
     .set_description("Min size (bytes) for a single extent map shard before merging"),
 
@@ -3983,17 +3983,17 @@ std::vector<Option> get_global_options() {
     .set_default(false)
     .set_description("Try to submit metadata transaction to rocksdb in queuing thread context"),
 
-    Option("bluestore_throttle_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("bluestore_throttle_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(64_M)
     .set_flag(Option::FLAG_RUNTIME)
     .set_description("Maximum bytes in flight before we throttle IO submission"),
 
-    Option("bluestore_throttle_deferred_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("bluestore_throttle_deferred_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(128_M)
     .set_flag(Option::FLAG_RUNTIME)
     .set_description("Maximum bytes for deferred writes before we throttle IO submission"),
 
-    Option("bluestore_throttle_cost_per_io", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("bluestore_throttle_cost_per_io", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(0)
     .set_flag(Option::FLAG_RUNTIME)
     .set_description("Overhead added to transaction cost (in bytes) for each IO"),
@@ -4113,7 +4113,7 @@ std::vector<Option> get_global_options() {
     .set_default(512)
     .set_description(""),
 
-    Option("kstore_max_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("kstore_max_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(64_M)
     .set_description(""),
 
@@ -4172,11 +4172,11 @@ std::vector<Option> get_global_options() {
     .set_default(true)
     .set_description("Enabling throttling of operations to backing file system"),
 
-    Option("filestore_wbthrottle_btrfs_bytes_start_flusher", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("filestore_wbthrottle_btrfs_bytes_start_flusher", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(41943040)
     .set_description("Start flushing (fsyncing) when this many bytes are written(btrfs)"),
 
-    Option("filestore_wbthrottle_btrfs_bytes_hard_limit", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("filestore_wbthrottle_btrfs_bytes_hard_limit", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(419430400)
     .set_description("Block writes when this many bytes haven't been flushed (fsynced) (btrfs)"),
 
@@ -4192,11 +4192,11 @@ std::vector<Option> get_global_options() {
     .set_default(500)
     .set_description("Start flushing (fsyncing) when this many distinct inodes have been modified (btrfs)"),
 
-    Option("filestore_wbthrottle_xfs_bytes_start_flusher", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("filestore_wbthrottle_xfs_bytes_start_flusher", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(41943040)
     .set_description("Start flushing (fsyncing) when this many bytes are written(xfs)"),
 
-    Option("filestore_wbthrottle_xfs_bytes_hard_limit", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("filestore_wbthrottle_xfs_bytes_hard_limit", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(419430400)
     .set_description("Block writes when this many bytes haven't been flushed (fsynced) (xfs)"),
 
@@ -4372,7 +4372,7 @@ std::vector<Option> get_global_options() {
     .set_default(50)
     .set_description("Max IO operations in flight"),
 
-    Option("filestore_queue_max_bytes", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    Option("filestore_queue_max_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(100_M)
     .set_description("Max (written) bytes in flight"),
 
index 61188b6c81f4c11996fd98ebc55dab8b4f7a554e..3dc025f02d23cf5f07c9463f0915d45b07c27dbf 100644 (file)
@@ -5569,7 +5569,7 @@ int OSDMonitor::prepare_pool_stripe_width(const unsigned pool_type,
       if (err)
        break;
       uint32_t data_chunks = erasure_code->get_data_chunk_count();
-      uint32_t stripe_unit = g_conf->get_val<uint64_t>("osd_pool_erasure_code_stripe_unit");
+      uint32_t stripe_unit = g_conf->get_val<Option::size_t>("osd_pool_erasure_code_stripe_unit");
       auto it = profile.find("stripe_unit");
       if (it != profile.end()) {
        string err_str;
index 5281bc562a95981f8eb7d65f9cbe9d5214db96e4..842ffa8e053f04815c18e3f444518d8a81f26127 100644 (file)
@@ -615,7 +615,7 @@ TEST(ErasureCodeLrc, encode_decode)
   profile["layers"] = description_string;
   EXPECT_EQ(0, lrc.init(profile, &cerr));
   EXPECT_EQ(4U, lrc.get_data_chunk_count());
-  unsigned int chunk_size = g_conf->get_val<uint64_t>("osd_pool_erasure_code_stripe_unit");
+  unsigned int chunk_size = g_conf->get_val<Option::size_t>("osd_pool_erasure_code_stripe_unit");
   unsigned int stripe_width = lrc.get_data_chunk_count() * chunk_size;
   EXPECT_EQ(chunk_size, lrc.get_chunk_size(stripe_width));
   set<int> want_to_encode;
@@ -745,7 +745,7 @@ TEST(ErasureCodeLrc, encode_decode_2)
   profile["layers"] = description_string;
   EXPECT_EQ(0, lrc.init(profile, &cerr));
   EXPECT_EQ(4U, lrc.get_data_chunk_count());
-  unsigned int chunk_size = g_conf->get_val<uint64_t>("osd_pool_erasure_code_stripe_unit");
+  unsigned int chunk_size = g_conf->get_val<Option::size_t>("osd_pool_erasure_code_stripe_unit");
   unsigned int stripe_width = lrc.get_data_chunk_count() * chunk_size;
   EXPECT_EQ(chunk_size, lrc.get_chunk_size(stripe_width));
   set<int> want_to_encode;