From b4dcdecb6aacfb934df2cb1a3505ae950bd92231 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 22 Jul 2017 17:54:59 +0800 Subject: [PATCH] mon/OSDMonitor: ENOENT on disabling non-existend app so we don't bother to trigger an pool update, which is potentially big stuff. Signed-off-by: xie xingguo --- qa/workunits/cephtool/test.sh | 1 + src/mon/OSDMonitor.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 41a036e8514ce..f7f45ccc41a87 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -2377,6 +2377,7 @@ function test_mon_pool_application() expect_false ceph osd pool application disable app_for_test rgw ceph osd pool application disable app_for_test rgw --yes-i-really-mean-it + ceph osd pool application disable app_for_test rgw --yes-i-really-mean-it # should be idempotent ceph osd pool ls detail | grep "application rbd" ceph osd pool ls detail --format=json | grep '"application_metadata":{"rbd":{}}' diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 3315e366eec0e..d39c3eed061d4 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6435,6 +6435,12 @@ int OSDMonitor::prepare_command_pool_application(const string &prefix, return -EPERM; } + if (!app_exists) { + ss << "application '" << app << "' is not enabled on pool '" << pool_name + << "'"; + return 0; // idempotent + } + p.application_metadata.erase(app); ss << "disable application '" << app << "' on pool '" << pool_name << "'"; -- 2.39.5