From c2225f874dcf37222d831b65b5a319d598d2fcd9 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 27 May 2014 10:06:46 +0200 Subject: [PATCH] mon: fix set cache_target_full_ratio 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 Signed-off-by: Loic Dachary --- qa/workunits/cephtool/test.sh | 1 + src/mon/OSDMonitor.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 8ed6bd12c015..f60e95bc7d1f 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -514,6 +514,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 diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index d5ea95447b01..63b75fde2382 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3516,7 +3516,7 @@ int OSDMonitor::prepare_command_pool_set(map &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; -- 2.47.3