Kefu Chai [Thu, 20 Dec 2018 03:24:28 +0000 (11:24 +0800)]
cls/rbd: init local var with known value
DirectoryState does not have an "invalid" enum so far, since it's
defined using `enum class`, init a value of this type with a known value
could be a better choice even it is always initialized before being read.
this silences the GCC warning of:
src/cls/rbd/cls_rbd.cc:3147:3: warning: ‘on_disk_directory_state’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
if (directory_state != on_disk_directory_state) {
^~
The stats entries for rgw buckets has a category, which used a
combination of uint8_t and enum RGWObjClass. Clean this up by
converting RGWObjClass to an enum class and using that
throughout. This provides type safety and better code clarity. Also,
add some source code documentation.
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
Kefu Chai [Wed, 2 Jan 2019 16:20:13 +0000 (00:20 +0800)]
osd/OSDMap: set pg_autoscale_mode with setting from conf
* update build_simple_optioned() to set pg_autoscale_mode with the setting
read from conf, otherwise it will be a random value in heap.
* update cli test accordingly, otherwise we will have
Kefu Chai [Tue, 1 Jan 2019 08:38:15 +0000 (16:38 +0800)]
crimson: workaround an ICE of GCC
this change works around the FTBFS on arm64:
/home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/crimson/common/config_proxy.h:74:13:
internal compiler error: in tsubst_decomp_names, at cp/pt.c:16537
for (auto& [obs, keys] : rev_obs) {
^~~
Please submit a full bug report,
with preprocessed source if appropriate.
it seems that this issue is a dup of
https://bugzilla.redhat.com/show_bug.cgi?id=1639019 .
Kefu Chai [Tue, 1 Jan 2019 07:49:05 +0000 (15:49 +0800)]
librbd: workaround an ICE of GCC
GCC is somehow annoyed at seeing the combination of decltype and
initializer_list in this place. i tried to remove the `if` clause, and
only left the `else` block, GCC was happy with that change. i also tried
to pass an empty `{}` to `decltype(reply.lockers)`, and GCC was also
happy with that. so i guess there are multiple factors taking effect in
this problem. probably any of them could be the last straw that breaks
GCC.
but we cannot have a minimal reproducer for this issue here without more
efforts. and `reply.lockers` is empty after `reply` is constructed, so
it would be simpler if we just add the locker info to it instead of
assigning a newly constructed `map` to it.
Sage Weil [Tue, 1 Jan 2019 04:31:18 +0000 (22:31 -0600)]
Merge PR #25597 into master
* refs/pull/25597/head:
mgr/hello: define some module options
pybind/mgr/mgr_module: normalize defaults to str when type is missing
mgr/telegraf: specify option types
mgr/telemetry: specify option types
mgr/zabbix: specify option types
mgr/localpool: document options and specify in native types
mgr/devicehealth: document options and specify in native types
mgr/balancer: document and specify options
common/options: make runtime vs not runtime explicit, not type-dependent
mon/MgrMonitor: mark module options with FLAG_MGR
mon/MgrMonitor: make find_module_option handle localized option names
pybind/mgr/mgr_module: set values as string
mgr: return options as appropriate python type
mgr/PythonCompat: python 3 cludges
pybind/mgr/mgr_module: make use of defined default value
mgr/PyModule: populate ModuleOptions and expose to mon
mon/ConfigMonitor: unify module options with built-in options
mon/MgrMonitor: populate options
mon/MgrMap: define ModuleOptions and include in map
common/options: expand type helpers and make them static
common/options: pin enums to values
Reviewed-by: Tim Serong <tserong@suse.com> Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Sage Weil [Tue, 1 Jan 2019 04:30:40 +0000 (22:30 -0600)]
Merge PR #25652 into master
* refs/pull/25652/head:
osd/OSDMap: disallow new upmaps on pgs that are pending merge
osd/PG: align past_intervals and last_epoch_clean for fabricated merge target
Sage Weil [Mon, 31 Dec 2018 17:05:03 +0000 (11:05 -0600)]
osd: reliably send pg_created messages to the mon
The OSD has to reliably deliver a pg_created message to the mon in order
for the mon to clear the pool's CREATING flag. Previously, a mon
connection reset would drop the message.
Restructure this to:
- queue a message any time a PG peers and the pool as the CREATING flag
- track pending messages in OSDService
- resend on mon connect
- prune messages for pools that no longer have the CREATING flag
This new strategy can result in resends of these messages to the mon in
cases where the mon already knows the PG was created. However, pool
creation is rare, and these extra messages are cheap. And we can avoid
this overhead if we like by limiting the number of PGs that the mon can
create explicitly if we choose (by lowering mon_osd_max_initial_pgs).
Fixes: http://tracker.ceph.com/issues/37775 Signed-off-by: Sage Weil <sage@redhat.com>
Kefu Chai [Sun, 30 Dec 2018 13:57:04 +0000 (21:57 +0800)]
osd: unlock osd_lock when tweaking osd settings
unlock osd_lock when serving "debug kick_recovery_wq" command
we need to unlock osd_lock temporarily when updating the osd settings,
otherwise we will run into assert failure. because
OSD::handle_conf_change() acquires the osd_lock which is not a recursive
lock.
Kefu Chai [Sun, 30 Dec 2018 13:46:55 +0000 (21:46 +0800)]
osd: use unlock_guard for unlock osd temporarily
when OSD::do_command() gets called, osd_lock is acquired. but when
serving some of these commands, we need to call methods which also
acquire the osd_lock by themselves. for instance,
OSD::handle_conf_change() gets called by cct->_conf.apply_changes().
to allow them to do so, we unlock osd_lock before calling those methods,
and re-lock it after done with them.
unlock_guard is introduced to unlock and re-lock the lock in a RAII style.
bluestore: silence Clang warning on possible uninitialize usuage
```
/home/wjw/ceph.head/ceph/src/os/bluestore/BlueStore.cc:5935:15: note: initialize the variable 'reserved' to silence this warning
int reserved;
^
= 0
1 warning generated.
```
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
Patrick Donnelly [Sun, 23 Dec 2018 04:16:13 +0000 (20:16 -0800)]
Merge PR #25619 into master
* refs/pull/25619/head:
mds: use frag_vec_t for efficient frag storage
mds: do not copy session map accidentally
mds: use vector for subtree access
include/frag: use more efficient small vectors
StackStringStream: add strv method short-cut
include: add small_vector encode/decode/<<
mds: scope using directives
David Zafman [Fri, 21 Dec 2018 21:25:10 +0000 (13:25 -0800)]
test: Disable duplicate request command test during scrub testing
Scrub testing requires an orderly control of scrubbing. Most but not
all the time, the duplicate scrub request is ignored because the first
request hasn't finished. Teuthology enables this environment variable
in the workunit handling.
Fixes: https://tracker.ceph.com/issues/36525 Signed-off-by: David Zafman <dzafman@redhat.com>
Patrick Donnelly [Sat, 22 Dec 2018 01:16:11 +0000 (17:16 -0800)]
Merge PR #25536 into master
* refs/pull/25536/head:
mds: don't wait for snapclient sync when handling reconnect
mds: extend reconnect period when mds is busy
mds: renew client session when receiving any message
mds: use mono_clock for reconnect timeout
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Sage Weil [Wed, 19 Dec 2018 22:59:09 +0000 (16:59 -0600)]
pybind/mgr/mgr_module: normalize defaults to str when type is missing
If the module doesn't specify a type for the option, it is probably
an older module. Make sure that the default value we provide is normalized
to a string, just in case the module declares something like
{
'name': 'my_option',
'default': True,
}
where the default is *not* a string, but an user-set value coming from
the config infrastructure would be a string.
Sage Weil [Wed, 19 Dec 2018 00:05:02 +0000 (18:05 -0600)]
mon/MgrMonitor: make find_module_option handle localized option names
If we get "mgr/$module/$instance/$option", normalize it to
"mgr/$module/$option" before looking it up. That's because a
'mgr/dashboard/x/server_port' in our database is really the
'mgr/dashboard/server_port' option.