Jianpeng Ma [Thu, 22 Nov 2018 08:25:20 +0000 (16:25 +0800)]
crimson/common: added templated LRU cache
the implementation is modeled after src/common/shared_cache.hpp, with
following changes/improvements
* split the implementation into two parts:
- simple_lru.h: for the basic LRU cache. which tracks the least recently
used (LRU) cache using a list, and uses a map for lookup. in
future, we could use boost's multiple-index-container to replace
this combination.
- shared_lru.h: for the improved version of LRU cache, it also tries
to track the evcited but still alive objects using a customized
deleter of shared_ptr, and it keeps a map of weak_ptr pointing to
these objects. the customized deleter will remove the tracked
item in weak_ptr map once all shared_ptrs are destroyed.
* specialize LRUCache for ordered and non-ordered lookup. in existing
OSD, `SimpleLRU` is used for caching the encoded osdmaps, and we
don't use `lower_bound()`, `upper_bound()` or `get_next()` accessors
for accessing these maps, so no need to store them with `std::map`.
and in crimson-osd, it would be great if we can ditch `SimpleLRU`,
and reuse `LRUCache` directly if `SharedLRU` is overkill. so let's
prepare for this by specializing for the `unordered_map<>`.
* remove (not yet) unused methods from SharedLRU, like `purge()`,
dump_weak_refs()
* change some function signatures to resemble those in `std::map`,
for instance,
- change `lookup()` to `find()`
- change `lookup_or_create()` to `operator[]()`
* add comment to document `SharedLRU` class
* add test for SharedLRU
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com> Signed-off-by: Kefu Chai <kchai@redhat.com>
Boris Ranto [Thu, 14 Feb 2019 09:35:56 +0000 (10:35 +0100)]
restful: Fix regression when traversing leaf nodes
The commit 23b6c90 introduced a regression when traversing leaf nodes.
The issue is that it traverses the keys of a `dict` returned by
`nodes_by_id`, not the actual `items` of the node. That resulted in an
500 error because it tried to treat `str` as a `dict` and failed.
Nathan Cutler [Tue, 15 Jan 2019 14:43:13 +0000 (15:43 +0100)]
rpm: move Python deps out of distro-conditional blocks
The python%{_python_buildid}-bcrypt and python%{_python_buildid}-requests RPMs
are identically named across all the RPM distros, so move them out of the
distro conditional blocks.
Sage Weil [Wed, 13 Feb 2019 22:22:40 +0000 (16:22 -0600)]
Merge PR #26389 into master
* refs/pull/26389/head:
message/MMonMgrReport: conditionally reencode PGMapDigest
qa/suites/upgrade/luminous-x/parallel: enable all classes
qa/suites/upgrade/luminous-x/parallel/5-final-workload/rados_mon_thrash: use x branch
qa/suites/upgade/luminous-x: pglog_hardlimit succeeds now on luminous due to backport
mgr/DaemonServer: use a luminous-compatible 'mgr metadata' command
mgr/Mgr: print bad (non-object) json
qa/suites/upgrade/luminous-x/stress-split: mons on separate hosts, enable msgr2
qa/suites/upgrade/luminous-x/parallel: mon per host, msgr2
qa/suites/upgrade/luminous-x: whitelist 'slow request'
mon/HealthMonitor: add mon_warn_on_msgr2_not_enabled
Sage Weil [Fri, 8 Feb 2019 19:46:00 +0000 (13:46 -0600)]
qa/suites/upgrade/luminous-x/parallel: enable all classes
Otherwise it's annoying because the class list changes between luminous and nautilus,
and we don't want to futz around with changing this setting during the upgrade.
The problematic classes are 'cas' (added) and 'sdk' (not enabled by default but
included by the cls/ workunit.
Kefu Chai [Thu, 7 Feb 2019 13:13:14 +0000 (21:13 +0800)]
msg/msg_types.h: do not cast `ceph_entity_name` to `entity_name_t` for printing
in GCC-9, `-Waddress-of-packed-member` is enabled, so we have warnings like:
src/msg/msg_types.h:142:41: warning: converting a packed 'const
ceph_entity_name' pointer (alignment 1) to a 'const entity_name_t'
pointer (alignment 8) may result in an unaligned pointer value
[-Waddress-of-packed-member]
142 | return out << *(const entity_name_t*)&addr;
| ^~~~
since the alignment of these two structures are different, we cannot
cast a structure with the alignment of 1 to a structure with the
alignment of 8. as the code generated by compiler accessing the members
of alignment 8 won't work with the members of alignment 1, we need to
create a temporary structure for printing it.
alfonsomthd [Wed, 13 Feb 2019 16:17:30 +0000 (17:17 +0100)]
mgr/dashboard: fix: tox not detecting deps changes
* tox.ini: replaced 'deps' setting by appropriate commands
due to this bug:
https://github.com/tox-dev/tox/issues/149
tox is not detecting changes in requirements.txt when using
'deps' setting in 'tox.ini'.
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
Kefu Chai [Tue, 12 Feb 2019 09:13:12 +0000 (17:13 +0800)]
rpm: split ceph-mgr-dashboard plugin into its own package
to make ceph-mgr-dashboard a separated package
- helps to reduce the repo size of downstream. because
ceph-mgr-dashboard is an architecture independent package. by
making it separated package avoids needless duplication of
the same data in mutiple .debs.
- gives user a fine grained control of selection.
Tim Serong [Wed, 13 Feb 2019 11:08:05 +0000 (22:08 +1100)]
ceph.spec.in: Make ceph-mgr own /usr/lib64/ceph/mgr directory
Without this, no package actually owns the /usr/lib64/ceph/mgr directory
so the build fails with "directories not owned by a package" errors for
ceph-mgr, ceph-mgr-diskprediction-local, ceph-mgr-diskprediction-cloud
and ceph-mgr-rook.
Tim Serong [Wed, 13 Feb 2019 11:05:28 +0000 (22:05 +1100)]
ceph.spec.in: Don't use noarch for ceph-mgr module subpackages
Even though ceph-mgr modules are notionally non-architecture-specific,
the files themselves are installed to an architecture-specific path
(/usr/lib64/ceph/mgr/....), which causes the build to fail on SUSE
distros with a huge long list of errors like:
ceph-mgr-diskprediction-cloud.noarch: E: suse-filelist-forbidden-noarch
(Badness: 10000) /usr/lib64/ceph/mgr/diskprediction_cloud is not
allowed in a noarch package
[...]
(none): E: badness 1120287 exceeds threshold 1000, aborting.
Kefu Chai [Tue, 12 Feb 2019 09:05:30 +0000 (17:05 +0800)]
debian: split ceph-mgr-dashboard plugin into its own package
to make ceph-mgr-dashboard a separated package
- helps to reduce the repo size of downstream. because
ceph-mgr-dashboard is an architecture independent package. by
making it separated package avoids needless duplication of
the same data in mutiple .debs.
- gives user a fine grained control of selection.
Jeff Layton [Thu, 7 Feb 2019 18:00:38 +0000 (13:00 -0500)]
mgr/dashboard: use orchestrator_cli to figure out the backend
Currently the dashboard has its own setting for the orchestrator
backend, which means that one has to set it in both the dashboard and
the orchestrator_cli module if you intend to use both.
Change the dashboard code to use the setting in the orchestrator_cli
module, and eliminate the dashboard-specific setting.
Jeff Layton [Thu, 7 Feb 2019 18:39:59 +0000 (13:39 -0500)]
mgr: make orchestrator_cli be always-on
The volumes module has at least a loose dependency on the orchestrator,
and thus also relies on the orchestrator_cli module for the backend
setting. Since the volumes module is always-on, do the same with the
orchestrator_cli module.
Yingxin Cheng [Wed, 30 Jan 2019 02:29:33 +0000 (10:29 +0800)]
crimson/net: crimson messenger performance test tool
Support the following settings:
* mode: both, client mode, server mode;
* set server address;
* rounds of messages;
* keepalive-ratio;
* block size;
* io-depth;