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.
Kefu Chai [Wed, 29 May 2019 09:45:35 +0000 (17:45 +0800)]
common/blkdev.c: check retval of snprintf()
as snprintf()'ed string could be truncated, to properly use this
function, we need to check its return value.
to silence warning like
../src/common/blkdev.cc: In member function ‘int64_t
BlkDev::get_string_property(blkdev_prop_t, char*, size_t) const’:
../src/common/blkdev.cc:165:15: warning: ‘%s’ directive output may be
truncated writing up to 4095 bytes into a region of size between 4085
and 4089 [-Wformat-truncation=]
165 | "%s/block/%s/%s", sysfsdir(), dev, propstr);
| ^~
In file included from /usr/include/stdio.h:873,
from /usr/include/c++/9/cstdio:42,
from /usr/include/c++/9/ext/string_conversions.h:43,
from /usr/include/c++/9/bits/basic_string.h:6493,
from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iterator:64,
from
/opt/ceph/include/boost/iterator/iterator_traits.hpp:10,
from
/opt/ceph/include/boost/range/iterator_range_core.hpp:26,
from
/opt/ceph/include/boost/algorithm/string/replace.hpp:16,
from ../src/common/blkdev.cc:31:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note:
‘__builtin___snprintf_chk’ output 9 or more bytes (assuming 4108) into a
destination of size 4096
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL
- 1,
|
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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`.