Kefu Chai [Fri, 31 May 2019 18:35:16 +0000 (02:35 +0800)]
tools/ceph-dencoder: split types.h into smaller pieces
instead of putting all types in a single compilation unit, split them
into smaller groups, in hope to reduce the memory footprint of compiler
when compiling ceph_dencoder.cc.
sometimes, GCC just fails to compile this source file.
Sage Weil [Wed, 29 May 2019 20:27:52 +0000 (15:27 -0500)]
Merge PR #27799 into master
* refs/pull/27799/head:
common/utime: don't pass %z to utime if there is a 'Z'
test: test json encode/decode of utime_t
mgr/ssh: parse new datetime
mgr/devicehealth: parse new datetime
mgr/crash: parse both old and new timestamp formats
mgr/telemetry: use cluster-provided timestamp unmolested
mon/MonMap: dump timestamps in UTC
qa/tasks/ceph: tolerate 'T' or ' ' as date and time separator
PendingReleaseNotes: note about change to ISO 8601 throughout
test/cli: update regexs for timestamps
log/LogClock: render timestamp in ISO 8601 format
common/ceph_time: stringify in ISO 8601 format
unittest_utime: add tests
common/utime: make parse() handle (our) ISO 8601 output
include/utime: make default string rendering ISO 8601 conformant
include/utime: remove unused s[n]printf methods
include/utime: make gmtime() output conformant ISO 8601
Reviewed-by: Kanika Murarka <kmurarka@redhat.com> Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
Sage Weil [Mon, 29 Apr 2019 19:32:44 +0000 (14:32 -0500)]
mgr/telemetry: use cluster-provided timestamp unmolested
The cluster stamp is now ISO 8601; just use that.
(The isoformat() puts a : in +hh:mm the timezone offset, which is slightly
different than what Ceph does; just pass Ceph's value through for
consistency.)
> In general we could remove it as the `buffer` library tends to
> disrespects `size_t` – `list::_len` and `ptr::_len` are both
`unsigned`.
> There are some exceptions like `size_t buffer::ptr::get_offset()`
(used
> altogether with `::advance` in `denc.h`) but they deserve rework as
> well.
and in this very case, we simply cast `size_t` to `unsigned`. so we
could silently trim a 64bits integer to 32bit on 64bits architecture.
so for better portability, we can just remove it. also, this function is
inlined, so the ABI is not changed.
Tiago Melo [Wed, 22 May 2019 08:58:36 +0000 (08:58 +0000)]
mgr/dashboard: Change the provider of services to root
It looks like that even if we provide a service only in 1 module, there are
still situations where angular will create multiple instances of that service.
By setting root as its providers, this no longer happens.
James Page [Wed, 29 May 2019 04:54:37 +0000 (05:54 +0100)]
common: avoid use of size_t in options
On 32 bit architectures size_t is not a 64 bit type
which causes comparison/assignment mismatch failures
during compilation - specifically in the handling of
legacy configuration values with boost::variant
records where size_t is not supported.
Kefu Chai [Wed, 29 May 2019 01:45:57 +0000 (09:45 +0800)]
ceph.in: do not preload libasan if it is not found
before this change, `asan_lib_path` could be `None` when we check it to
see if it ends with `NOTFOUND`. this happens if WITH_SEASTAR=OFF or
WITH_ASAN=OFF, as in that case, find_package(Sanitizers) is not called,
hence `ASAN_LIBRARY` won't be set.
in this change, libasan is only preloaded if
- (WITH_SEASTAR=ON and CMAKE_BUILD_TYPE=Debug and ASAN_LIBRARY is found)
or
- (WITH_ASAN)
Tatjana Dehler [Wed, 3 Apr 2019 14:24:11 +0000 (16:24 +0200)]
mgr/dashboard: Consider user permissions
Consider user permissions when showing advanced table actions and hide
all buttons requiring missing permissions from the user.
Also consider user permissions when showing submit buttons.
Tatjana Dehler [Fri, 1 Mar 2019 15:11:53 +0000 (16:11 +0100)]
mgr/dashboard: Add PG scrub configuration form
The commit adapts two different parts:
1. It adds all frontend related changes around the PG scrub
configuration form
2. It also adds an API test case to check the existence of
all hard-coded config options in the frontend
Fixes: https://tracker.ceph.com/issues/38211 Signed-off-by: Tatjana Dehler <tdehler@suse.com>
Tatjana Dehler [Wed, 6 Mar 2019 15:42:28 +0000 (16:42 +0100)]
mgr/dashboard: Add config option component
This commit adds an initial config option component in order to move
the HTML template and the config option types related code to an own
centralized place to be re-usable by other components
Tatjana Dehler [Wed, 13 Mar 2019 13:51:43 +0000 (14:51 +0100)]
mgr/dashboard: Add config filter and delete routes
Add a filter route to the configurations endpoint to get a subset of
config options in one request.
Add a delete route to the configurations endpoint to delete a
specific config option value.
The commit contains the frontend and backend related changes.
It also adds the missing '/' to `ConfigurationService.bulkCreate` and
unit test.
Kefu Chai [Wed, 15 May 2019 04:46:10 +0000 (12:46 +0800)]
blobhash: do not use cast for unaligned access
* remove the uncorrect comment. as std::hash<> does not apply to a
customized type. see https://en.cppreference.com/w/cpp/utility/hash
* do not use cast for accessing an uint32_t by dereferencing (void *)
or (char *) pointer. because the alignment requirement of `uint32_t`
is stricter than that of `void*` or `char *`. we need to do an
explicit memcpy() for accessing the uint32_t pointed by the pointer.
see also https://www.kernel.org/doc/Documentation/unaligned-memory-access.txt
* instead of using a loop for mixing the last few bytes. use a switch-
case. so GCC-9 won't complain with
```
../src/include/blobhash.h:38:10: warning: iteration 4 invokes undefined
behavior [-Waggressive-loop-optimizations]
38 | sh += 8;
| ~~~^~~~
../src/include/blobhash.h:36:12: note: within this loop
36 | while (len) {
| ^~~
```
at seeing `sh += 8;`
* instead of mixing the last bits repeatly by derefencing `p` using
`uint32_t`, while move it forwards with step size of `1`, mix
the bits byte-wise.
* include <cstdint>. this header file is supposed to be self-contained.
* use `std::uint32_t` instead of using `uint32_t`. we cannot assume
somebody is `using namespace std` or `using std::uint32_t` for us.
* mark the operator() `const noexcept`. see
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c89-make-a-hash-noexcept
for the rationale behind this
This patch fixes raw_bytes_used key which was renamed to stored_raw.
Also added key percent_used and fixed zabbix template to be fully
compatible with zabbix 3.0
Volker Theile [Mon, 6 May 2019 14:26:37 +0000 (16:26 +0200)]
monitoring: SNMP OID per every Prometheus alert rule
Use the Ceph enterprise OID 50495 (https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers) and create OIDs for every Prometheus alert rule according to the schema at https://github.com/SUSE/prometheus-webhook-snmp/blob/master/README.md.
Example OID:
1.3.6.1.4.1.50495.15.1.2.2.1
All alert rule OIDs are located below the object identifier 15 (15 for p which is the first character of prometheus). Check out the MIB at https://github.com/SUSE/prometheus-webhook-snmp/blob/master/PROMETHEUS-ALERT-CEPH-MIB.txt for more details.
simon gao [Tue, 28 May 2019 02:36:32 +0000 (22:36 -0400)]
mds: avoid sending too many osd requests at once after mds restarts Fixes: http://tracker.ceph.com/issues/40028 Signed-off-by: simon gao <simon29rock@gmail.com>
Kefu Chai [Mon, 27 May 2019 11:55:59 +0000 (19:55 +0800)]
common: no need to include ceph_assert.h
src/common/convenience.h is a header-only library, and it does not use
dout or ceph_assert() utilities. so there is no need to include
`ceph_assert.h`.
xie xingguo [Thu, 9 May 2019 07:02:44 +0000 (15:02 +0800)]
mgr/balancer: fix initial weight-set value for newly created osds
This is a follow-up fix for https://github.com/ceph/ceph/pull/26955,
which should make any OSD addition start with a zeroed weight-set weight.
But without this fix, the balancer won't be able to handle it properly..
Kefu Chai [Mon, 27 May 2019 05:04:41 +0000 (13:04 +0800)]
test/librados_test_stub: define more stub functions
this change helps to silence warnings like:
Failed to load class: cas
(/home/jenkins-build/build/workspace/ceph-pull-requests/build/lib/libcls_cas.so):
/home/jenkins-build/build/workspace/ceph-pull-requests/build/lib/libcls_cas.so:
undefined symbol:
_Z27cls_cxx_chunk_write_and_setPviiPN4ceph6buffer7v14_2_04listEjS4_i
currently, LibradosTestStub.cc only offers the minimum set of APIs used by
class objects to support librbd related tests. but when
`TestClassHandler::open_class()` enumates the object classes and then
tries to load them, some of the classes fail to load due to unresolvable
symbols. it's fine in the sense that these classes are not tested by the
librbd tests. but these warning messages are just annoying and sometimes
misleading, so in this change, the missing symbols are added as dummy
stubs which just returns `-ENOTSUP` to silence the messages.
Mykola Golub [Fri, 24 May 2019 06:07:51 +0000 (07:07 +0100)]
journal: optimize object overflow detection
Previously to detect overflow we were sending journal append
requests until -EOVERFLOW is returned by osd. This means that we
had at least one waste (rejected) request per object set (though
there may be more if the number of in-flight appends is not
limited).
We can easily predict when the osd will start to return
-EOVERFLOW and avoid such additional requests.
Tiago Melo [Thu, 23 May 2019 16:18:22 +0000 (16:18 +0000)]
mgr/dashboard: Subscribe to changes when RequiredIf is used
FormControls that use 'requiredIf' validators depend on the state of other
controls.
To prevent that some of the state changes are not tracked, we now automatically
subscribe to the prerequsited controls and update the validation of the parent
control.