Rodrigo Severo [Fri, 10 Jan 2020 14:38:19 +0000 (11:38 -0300)]
doc/install/upgrading-ceph: using systemd commands in Ubuntu instructions
Before this change, we were using the "restart" command which is a symlink to
initctl(8). and it's offered by upstart. since ubuntu/vivid, ubuntu moved from
upstart to systemd.
Please see https://lists.ubuntu.com/archives/ubuntu-devel/2016-July/039465.html
Casey Bodley [Mon, 13 Jan 2020 19:44:47 +0000 (14:44 -0500)]
Merge pull request #32534 from cbodley/wip-43512
rgw multisite: enforce spawn window for incremental data sync
Reviewed-by: Daniel Gryniewicz <dang@redhat.com> Reviewed-by: Eric J. Ivancich <ivancich@redhat.com> Reviewed-by: Shilpa Jagannath <smanjara@redhat.com>
Kefu Chai [Sun, 12 Jan 2020 09:59:11 +0000 (17:59 +0800)]
ceph.spec.in: package .pyc files on el7
* package .pyc files on el7
per
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_byte_compiling
it's required to package .pyc files
* use python3 to bytecompile .py files on el7
per
https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation#Status_quo,
`brp-python-bytecompile` script bytecompile .py files automatically, the
.py files under interpreter-specific directories, such as `/usr/lib/python3.6/`,
are compiled using the appropriate compiler. but the mgr modules are
located under `/usr/share/ceph/mgr/`. they are compiled using
`${__python}`, which is still python2 in RHEL/CentOS 7. since we've
dropped the support of python2 in octopus. we should either stop
bytecompiling the .py source files or start using python3 to compile
them. otherwise python2 will fail to compile source files using python3
specific syntax like:
Jason Dillaman [Sun, 12 Jan 2020 15:05:04 +0000 (10:05 -0500)]
rbd-mirror: skip closing local image if it was already closed
If the journal replayer finishes relaying (error or promotion), it will
close the local image. However, the image replayer state machine will also
shut down the journal replayer (again) which might result in attempting
to close the local image again.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Kefu Chai [Sat, 11 Jan 2020 14:41:59 +0000 (22:41 +0800)]
common/strtol.cc: refactor strict_si_cast() to silence warnings
to silence warnings like
../src/common/strtol.cc:286:7: warning: implicit conversion from 'promoted_t' (aka 'long long') to 'double' changes value from 9223372036854775807 to 9223372036854775808
[-Wimplicit-int-float-conversion]
static_cast<promoted_t>(std::numeric_limits<T>::max()) / pow (10, m)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
../src/common/strtol.cc:294:15: note: in instantiation of function template specialization 'strict_si_cast<long>' requested here
template long strict_si_cast<long>(std::string_view str, std::string *err);
^
Kefu Chai [Sat, 11 Jan 2020 14:30:49 +0000 (22:30 +0800)]
src/: mark final class as final
to silence warnings from clang-10 like:
```
../src/os/bluestore/ceph_aio.h:120:18: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
~aio_queue_t() final {
^
../src/os/bluestore/ceph_aio.h:108:8: note: mark 'aio_queue_t' as 'final' to silence this warning
struct aio_queue_t : public io_queue_t {
^
1 warning generated.
```
Kefu Chai [Sat, 11 Jan 2020 08:37:17 +0000 (16:37 +0800)]
crimson: avoid creating temporary with protected dtor
to address the compiler error from clang 9.0.1:
../src/crimson/os/cyanstore/cyan_collection.cc:16:34: error: temporary of type 'boost::intrusive_ref_counter<Object, boost::thread_unsafe_counter>' has protected destructor
return new crimson::os::Object{};
^
/opt/ceph/include/boost/smart_ptr/intrusive_ref_counter.hpp:157:30: note: declared protected here
BOOST_DEFAULTED_FUNCTION(~intrusive_ref_counter(), {})
^
Kefu Chai [Sat, 11 Jan 2020 08:26:54 +0000 (16:26 +0800)]
crimson: move() explicitly to avoid copy
to silence following warnings from clang 9.0.1:
src/crimson/osd/heartbeat.cc:143:14: warning: local variable 'extras' will be copied despite being returned by name [-Wreturn-std-move]
return extras;
^~~~~~
../src/crimson/osd/heartbeat.cc:143:14: note: call 'std::move' explicitly to avoid copying
return extras;
^~~~~~
std::move(extras)
Kefu Chai [Sat, 11 Jan 2020 08:07:42 +0000 (16:07 +0800)]
crimson: do not capture unused variables
this silences warnings from clang:
src/crimson/osd/heartbeat.cc:109:14: warning: lambda capture 'this' is
not used [-Wunused-lambda-capture]
.then([this, &info=peer_info->second] (auto xcon_front, auto
xcon_back) {
^~~~~
Kefu Chai [Sat, 11 Jan 2020 10:29:29 +0000 (18:29 +0800)]
cmake: do not include global_context.cc multiple times
otherwise ODR is violated:
==449025==ERROR: AddressSanitizer: odr-violation (0x000000f03700):
[1] size=8 'g_ceph_context' ../src/global/global_context.cc:24:14
[2] size=8 'g_ceph_context' ../src/global/global_context.cc:24:14
These globals were registered at these points:
[1]:
#0 0x4779bd in __asan_register_globals (/var/ssd/ceph/clang-build/bin/ceph-conf+0x4779bd)
#1 0x56e9cb in asan.module_ctor (/var/ssd/ceph/clang-build/bin/ceph-conf+0x56e9cb)
[2]:
#0 0x4779bd in __asan_register_globals (/var/ssd/ceph/clang-build/bin/ceph-conf+0x4779bd)
#1 0x7fe5fed12aeb in asan.module_ctor (/var/ssd/ceph/clang-build/lib/libceph-common.so.2+0x2f34aeb)
==449025==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
Ronen Friedman [Sat, 11 Jan 2020 07:42:49 +0000 (09:42 +0200)]
crimson: fix aarch64 ctest failure by removing some lambda attributes
There seems to be no "universally accepted" way to declare a lambda as
[[always_inline]]. "Universally accepted" here meaning: accepted with
no error or warning by gcc8, gcc9 and clang.
See for example: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60503
Patrick Donnelly [Sat, 11 Jan 2020 00:16:00 +0000 (16:16 -0800)]
Merge PR #32213 into master
* refs/pull/32213/head:
cephfs-shell: don't catch libcephfs.Error unnecessarily
cephfs-shell: make every command set a return value on failure
pybind/cephfs: move LibCephFSStateError closer to base class
pybind/cephfs: add method to get error code in Error and OSError
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Milind Changire [Fri, 10 Jan 2020 06:31:34 +0000 (12:01 +0530)]
mds: throttle scrub start for multiple active MDS
* add check to "scrub start" command handler to dishonor request if
multiple MDS are "active" for a recursive scrub request
* add check to MDSRank::handle_mds_map() to see if scrubbing is in
progress and max_mds is greater than 1, if so then scrubbing is
aborted. This is supposed to take care of the condition when scrubbing
has been started with max_mds == 1 and then bumped to a higher value
Kefu Chai [Fri, 10 Jan 2020 05:28:10 +0000 (13:28 +0800)]
qa/tasks/mgr: set mgr module option with --force
if mgr is not active, monitor will refuse to set any option consumed by
mgr modules.
the reason the tests pass somtimes is that, we have a racing here:
1. stop all mgr daemons
2. MgrMonitor gets updated and updates its mgr_module_options
accordingly.
3. in TestDashboard.setUp(), we reset the port number for dashboard
using "ceph config set mgr mgr/dashboard/y/ssl_server_port 7789"
4. restart all mgr daemons
but the 2nd step and 3rd step could race with each other, if the 2nd
step happens after 3rd step, the test passes. otherwise it fails.
in this change, "--force" is passed to the "ceph config set" command,
so ConfigMonitor can bypass the sanity test for the option, and just
set this option.
Jason Dillaman [Wed, 8 Jan 2020 14:21:30 +0000 (09:21 -0500)]
rbd-mirror: bootstrap and related state machines now uses StateBuilder
This removes all the journal-specific variables from the image replayer
and bootstrap state machines. Instead, these details are hidden behind
the abstract StateBuilder class and its derived journal class.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Wed, 8 Jan 2020 19:29:15 +0000 (14:29 -0500)]
rbd-mirror: journal helper state machines now inherits from simple BaseRequest
The StateBuilder will need to construct and return a simple interface when
creating the CreateLocalImageRequest and PrepareReplayRequest state machines
regardless of whether it's for journal or snapshot mirroring.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Tue, 7 Jan 2020 15:50:34 +0000 (10:50 -0500)]
rbd-mirror: created simple shell image replayer state builder
This state builder will separate common logic for journal + snapshot
mirroring and allow an abstract query and builder APIs for abstracting
the deltas between the two implementations.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 6 Jan 2020 20:22:52 +0000 (15:22 -0500)]
rbd-mirror: allow bootstrap to populate remote image id
The remote image id is used as a sanity check and a test for
permanently shutting down the replayer after the remote image is
deleted. Recent refactor work broke this by passing the remote
image id by value.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Kefu Chai [Thu, 9 Jan 2020 11:36:37 +0000 (19:36 +0800)]
qa/tasks/cephfs_test_runner: setattr to class not instance
before this change, `setattr()` sets the instance specialized with a certain method
of test case, so in `MgrTestCase.setUpClass()`
assert cls.mgr_cluster is not None
fails,
after this change, instead of test case, the class of test suite is updated with the
specified params, even if we pass a certain test to test runner.
so we can
Rishabh Dave [Fri, 13 Dec 2019 06:51:03 +0000 (12:21 +0530)]
pybind/cephfs: move LibCephFSStateError closer to base class
At first look it appears that class OSError is the only class derived
from class Error which makes class Error look redundant. Therefore, it's
better to move class LibCephFSStateError from the bunch of exception
classes derived from OSError to closer to class Error.