From 9da5cb75c6b892b33af9a4878a9262d687d785bf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 20 Jan 2020 16:50:30 -0600 Subject: [PATCH] mon/ConfigMonitor: always prefix global config keys with global/ This avoids some ambiguity. For instance, we cannot trivially tell if config/mgr/module/option is an option called module/option that we don't understand that's in the mgr section, or a mgr/module/option option in global. In any case, it's simpler to have a universal prefix. Also, this aligns the storage schema with what assimilate-conf does (it adds global/ for the global section). Fixes: https://tracker.ceph.com/issues/43296 Signed-off-by: Sage Weil --- src/mon/ConfigMap.cc | 1 + src/mon/ConfigMonitor.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/mon/ConfigMap.cc b/src/mon/ConfigMap.cc index b7343ce4264..258b75952c7 100644 --- a/src/mon/ConfigMap.cc +++ b/src/mon/ConfigMap.cc @@ -174,6 +174,7 @@ bool ConfigMap::parse_mask( for (unsigned j = 0; j < split.size(); ++j) { auto& i = split[j]; if (i == "global") { + *section = "global"; continue; } size_t delim = i.find(':'); diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index fdb234e0911..ab67b3a90fb 100644 --- a/src/mon/ConfigMonitor.cc +++ b/src/mon/ConfigMonitor.cc @@ -540,6 +540,8 @@ bool ConfigMonitor::prepare_command(MonOpRequestRef op) string key; if (section.size()) { key += section + "/"; + } else { + key += "global/"; } string mask_str = mask.to_str(); if (mask_str.size()) { -- 2.39.5