improve OPTION macro to add a check function for invalid options.
see #11484, where user input a very large number for the journal_queue_max_bytes settings. this number overflows and ceph interprets it as a negative number which crashes ceph-osd.
and elder one proposed a way to prevent this from happening again.
I propose if any value in config file is out of range, Ceph could use default value for that and warn about that on startup.
and IMO, we should stop at seeing such an error, and report it to the user immediately, instead of swallowing it. if user tries to change a valid setting to an invalid one, we should reject it
maybe we should shutdown gracefully at seeing a bad config value when starting up, but reject it at runtime.
probably we can
- wire up a checker functor to an option when defining it using the OPTION macros
- run this functor (it throws on bad option) in
md_config_t::set_val()before applying the new setting
- reject this setting, and prompt user
- stop the daemon if it is booting up