From a1214a702cfd8465deb91847f4dc63c0e80fb586 Mon Sep 17 00:00:00 2001 From: Zhi Zhang Date: Thu, 25 May 2017 16:05:31 +0800 Subject: [PATCH 1/2] Pass empty string to clear mantle balancer Signed-off-by: Zhi Zhang --- src/mon/FSCommands.cc | 5 ++++- src/pybind/ceph_argparse.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 630736c398990..0ef7c8a2d43a8 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -295,7 +295,10 @@ class SetHandler : public FileSystemCommandHandler }); } } else if (var == "balancer") { - ss << "setting the metadata load balancer to " << val; + if (val.empty()) + ss << "unsetting the metadata load balancer"; + else + ss << "setting the metadata load balancer to " << val; fsmap.modify_filesystem( fs->fscid, [val](std::shared_ptr fs) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 9328b6c47d871..f188d8f236ac3 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -920,12 +920,12 @@ def validate(args, signature, flags=0, partial=False): # no arg, but not required? Continue consuming mysig # in case there are later required args - if not myarg and not desc.req: + if myarg == None and not desc.req: break # out of arguments for a required param? # Either return (if partial validation) or raise - if not myarg and desc.req: + if myarg == None and desc.req: if desc.N and desc.numseen < 1: # wanted N, didn't even get 1 if partial: From bd8c06de9a4f67f4ef41b573771d24292196e592 Mon Sep 17 00:00:00 2001 From: Zhi Zhang Date: Thu, 25 May 2017 16:34:46 +0800 Subject: [PATCH 2/2] mds/MDBalancer: put heartbeat msg ref after using mantle balancer Signed-off-by: Zhi Zhang --- src/mds/MDBalancer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 17a055154aa2a..fe941abf1439d 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -393,7 +393,7 @@ void MDBalancer::handle_heartbeat(MHeartbeat *m) /* avoid spamming ceph -w if user does not turn mantle on */ if (mds->mdsmap->get_balancer() != "") { int r = mantle_prep_rebalance(); - if (!r) return; + if (!r) goto out; mds->clog->warn() << "using old balancer; mantle failed for " << "balancer=" << mds->mdsmap->get_balancer() << " : " << cpp_strerror(r);