Commit Graph

83840 Commits

Author SHA1 Message Date
Sage Weil
0db8fd2418 common/ceph_context: implement 'config unset <var>'
Clear an override value (if any).  This works for 'ceph daemon ...'
asok commands.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
948e308c6d mon/ConfigMonitor: show fabricated options as level 'unknown'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d9dfece0dc mon/ConfigMonitor: include LEVEL column in config dump|get
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
2a55463461 mon/ConfigMap: const * to Option, so we don't have to copy it
These are biggish structs (lots of strings), so it's expensive to make
copies of Option when it is an immutable struct.  However, we need to
handle arbitrary strings that we don't recognize, too.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
cf68ce511f mgr: have MgrStandby send mgr reports to active mgr (even self!)
This allows the mgr daemons to register state with the active mgr just
like the rest of the cluster, including perfcounters and current config.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
a1ca906a63 mon/ConfigMonitor: 'config help'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
49a5e775aa common/options: fix dump()
By convention dump() does not include the containing object section.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
86a6cf778c common/options: operator<< for value_t
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
ef447b39ec vstart.sh: move debug values over to mon config
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
0b3cfbe644 ceph-osd: do not set/override osd_objectstore config option
We use the one on disk, and nobody consumes the option except ceph-volume/
ceph-disk during mkfs.  Do not pollute the config space with a value that
isn't consumed.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
6621b2b49d common/config: "conffile" -> "file"
Easier on the eyes

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
06bf4334f5 common/config: exclude host, fsid from config reproted to mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d75459351f mon/ConfigMonitor: load_config() a bit less often
We could get very clever and avoid reparsing the full config every time
too, but that is a bit more work.  Leave that as a TODO.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
db62d92427 mon/ConfigMonitor: implement 'config {rm,get,dump}'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
1ae4f0db95 mgr: remove old 'config set' command
This is a cli command to set a config option on the mgr.  It doesn't
really belong because it only sets it on the mgr that happens to be
active.  It was probably mixed up with the asok or tell command.

Added in 057b73d641

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
fdde016301 mon/MonClient: one-shot mon connection on started to fetch config
This is not particularly efficient, but it works:

 - connect to the monitor to get the monmap and config
 - tear it all down
 - proceed with normal startup (which presumably involves reconnecting
   to the mon all over again).

This allows us to set config options that may affect the mon communication
itself, like ms_type.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
f999e8aa54 mon/ConfigMonitor: always send initial config, even if empty
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
c9f1fb841c common/ceph_context: count crypto/shutdown cycles
We need to allow crypto to be set up and torn down before a fork.  Count
the init/shutdown cycles to make that safe.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
4c7e382a47 common/ceph_context: whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
a524868161 mon: handle MGetConfig
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
e76a189732 vstart.sh: use mon config for many things
We also trim out some obsolete options while we're at it.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
936de8b3db mon: 'config set <who> <name> <value>'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
2f9617d801 mon/ConfigMonitor: refresh mon configs too
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
3b0fc9537e mon/ConfigMap: some improvements
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
7ccd515f82 mon/ConfigMap: move option mask parsing into helper
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d3dac3d280 mgr/DaemonServer: 'config show <who>'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d8450574cf mgr/MgrClient: report running config to mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
e82f925eb3 mon/ConfigKeyService: add 'prefix' arg to 'config-key dump ...'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
8bd1f8d338 vstart.sh: less config noise
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
bb4151ea0d common/options: remove obsolete 'crushtool' option
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
7940f66b64 mon/MonClient: subscribe to config, handle updates
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
38db0a289f mon/ConfigMonitor: add monitor service for distributing configs
Add 'config' subscribe option to get MConfigs on auth and when config is
updated.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
43a9d164d6 mon/ConfigMap: parsed cluster-wide config
Breaks down options by global, type, daemon, and can filter options by
crush location.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
081e52c7bf messages/MConfig: send config map
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
9647e50886 common/config: set_mon_vals()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
37fe36fbe5 common/config: some cleanup; rm_val
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
d4cc161566 cleanup: src/.libs -> build/lib
Clean up remaining traces of automake's .libs.  This makes unittest_*
tests easier to run by hand (mostly).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
f8d4e5b5e9 common/config: rewrite (╯°□°)╯︵ ┻━┻
This is too complete a rewrite to reasonably break down into small steps,
and even if I could, it would be harder to review that way than to simply
review the new implementation.  The semantics of the old one were so weird
that it's harder to reason about the change in behavior than to simply
review the new behavior.

That's my story, at least, and I'm sticking to it!

So, here are the highlights:

 - $foo meta expansions are evaluated at get_val() time.  This means the
weird bool arguments to set_val specifying whether things were expanded
are removed (they didn't make any sense unless you were thinking about the
old implementation).
 - for every option, we track values from any inputs (config, mon,
   override).  At get_val() time, we pick the highest priority one.
 - diff() is rewritten to be simple and to show you all of the above.
 - internal interfaces are simplified, and in terms of Option::value_t
   whenever possible.
 - unit tests simplified somewhat based on the above.

Known issues:

 - legacy values get pushed out in select cases.  Notably if foo=$bar
   and bar is updated, we do not update $foo (there is no dependency
   tracking to do this efficiently).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
55f902f267 common/config: whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:10 -06:00
Sage Weil
dfd07f3820 common/config: streamline get_val_generic
Lookup value first; avoid a schema lookup entirely.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:10 -06:00
Sage Weil
db655f800a common: refactor default config value handling
- pass an optional map<string,string> instead of an arg list
- remember default values in md_config_t
- some nicer helpers

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:10 -06:00
Sage Weil
955537776b os/bluestore: pass rocksdb options via map, not global config
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:10 -06:00
Sage Weil
33a333ebaa kv/KeyValueDB: pass kv_options map to ctor
This will let us avoid passing options via global config options.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
e6612ade1d common/config: make debug_* regular options
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
08eaca61be crush/CrushWrapper: get_full_location by name
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
4161e804d7 common/config: move parse_value() into Option
It is more reuable there.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
02e57753e5 common/config: new get_val() variant
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
da11800d30 common/config: record is_daemon
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
64a5332766 common/config: find_option
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00
Sage Weil
004357a03b common: don't pass alt_def_args if we don't use them
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:09 -06:00