]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: fix ignoring --no-mon-config 46965/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 5 Jul 2022 12:20:23 +0000 (12:20 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 5 Jul 2022 12:46:16 +0000 (12:46 +0000)
Before we were treating the `--no-mon-config` as one of the
`seastar_n_early_args`. However, this was wrong as it truly
belongs to `config_proxy_args` as:

```cpp
int md_config_t::parse_argv(ConfigValues& values,
                            const ConfigTracker& tracker,
                            std::vector<const char*>& args, int level)
{
    // ...
    else if (ceph_argparse_flag(args, i, "--no-mon-config", (char*)NULL)) {
      values.no_mon_config = true;
    }
    // ...
}
```

The net result of this ignoring `--no-mon-config` which was
the reason behind many dead jobs at Sepia.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/main.cc

index 7a36176c735f789608feb40ab74fe3c999957b4b..98d3a2e9f2d103b18d555d178db6a228ed9b89e3 100644 (file)
@@ -202,7 +202,6 @@ int main(int argc, const char* argv[])
     ("mkfs", "create a [new] data directory")
     ("debug", "enable debug output on all loggers")
     ("trace", "enable trace output on all loggers")
-    ("no-mon-config", "do not retrieve configuration from monitors on boot")
     ("prometheus_port", bpo::value<uint16_t>()->default_value(0),
      "Prometheus port. Set to zero to disable")
     ("prometheus_address", bpo::value<std::string>()->default_value("0.0.0.0"),
@@ -313,10 +312,10 @@ int main(int argc, const char* argv[])
           if (config.count("mkkey")) {
             make_keyring().get();
           }
-          if (config.count("no-mon-config") == 0) {
-            fetch_config().get();
-          } else {
+          if (local_conf()->no_mon_config) {
             logger().info("bypassing the config fetch due to --no-mon-config");
+          } else {
+            fetch_config().get();
           }
           if (config.count("mkfs")) {
             auto osd_uuid = local_conf().get_val<uuid_d>("osd_uuid");