]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix set cache_target_full_ratio
authorLoic Dachary <loic@dachary.org>
Tue, 27 May 2014 08:06:46 +0000 (10:06 +0200)
committerSage Weil <sage@inktank.com>
Fri, 27 Jun 2014 20:16:37 +0000 (13:16 -0700)
It was a noop because it was incorrectly using the variable n. Add a
test to protect against regression.

http://tracker.ceph.com/issues/8440 Fixes: #8440

Reported-by: Geoffrey Hartz <hartz.geoffrey@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit c2225f874dcf37222d831b65b5a319d598d2fcd9)

qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc

index 80f3f4c2269bbaf7e5ca3f67a3bb6a2c2f87a9cf..a07dd61b7605a4acbf6caf0a45bbebab4b6bf879 100755 (executable)
@@ -515,6 +515,7 @@ ceph osd pool set rbd cache_target_dirty_ratio .123
 expect_false ceph osd pool set rbd cache_target_dirty_ratio -.2
 expect_false ceph osd pool set rbd cache_target_dirty_ratio 1.1
 ceph osd pool set rbd cache_target_full_ratio .123
+ceph osd dump -f json-pretty | grep '"cache_target_full_ratio_micro": 123000'
 ceph osd pool set rbd cache_target_full_ratio 1.0
 ceph osd pool set rbd cache_target_full_ratio 0
 expect_false ceph osd pool set rbd cache_target_full_ratio 1.1
index 65f3889d4de7a5db2270d24891e85d568ad3582d..6d6999fa0d2bff99b4e0bfb2fc7d1169526226c1 100644 (file)
@@ -3513,7 +3513,7 @@ int OSDMonitor::prepare_command_pool_set(map<string,cmd_vartype> &cmdmap,
       ss << "value must be in the range 0..1";
       return -ERANGE;
     }
-    p.cache_target_full_ratio_micro = n;
+    p.cache_target_full_ratio_micro = f * 1000000;
   } else if (var == "cache_min_flush_age") {
     if (interr.length()) {
       ss << "error parsing int '" << val << "': " << interr;