]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd: fix argument parsing after seastar changes 45993/head
authorMark Nelson <mnelson@redhat.com>
Wed, 20 Apr 2022 19:45:45 +0000 (19:45 +0000)
committerMark Nelson <mnelson@redhat.com>
Fri, 22 Apr 2022 14:08:58 +0000 (14:08 +0000)
commit6d05a4d35359f3b48cb19ecaadf3756bc6e3a3ea
treee6b541d4c32d936a9427c36144681b5ebcf1c5d6
parented556e6bc97a7585da2b219e7756ba9013675d67
crimson/osd: fix argument parsing after seastar changes

Last fall seastar changed the way that app-template works, separating internal "seastar" options from "app" options. Part of that change was to only return app_opts when get_options_description() is called, which is what we use to filter arguments that should be passed to seastare instead of crimson. This has the unfortunate effect of breaking all "seastar" options we pass to seastar such as "--memory" or "--cpuset". There is no way currently to access the internal seastar options short of scraping and parsing stdout (private member without an accessor). The PR that made the change can be seen here:

https://groups.google.com/g/seastar-dev/c/RQs-1JqqnRg

Potentially we could use our existing code if we got the seastar devs to provide something like "get_all_options_descrption(), but I don't think we should rely on a function like this. They clearly aren't intending for projects to rely on this behavior for argument filtering. It's brittle and something we can't easily fix ourselves if there are future problems.

Instead, we should filter our own options from argv and then pass what remains to seastar. Previously we didn't do this because crimson::common:ConfigProxy isn't available until seastar starts up, so we can't use it to filter out which options to give seastar (chicken and egg problem). We don't actually need ConfigProxy to filter the arguments though. It's good enough to create a throw-away md_config_t instance, give it a dummy tracker, and then let it parse the arguments as it normally does. This let's us filter out the arguments to give seastar before seastar itself starts up, which then let's us filter which arguments we should eventually pass to crimson's ConfigProxy.

Signed-off-by: Mark Nelson <mnelson@redhat.com>
src/crimson/osd/main.cc