Kefu Chai [Fri, 1 Nov 2019 05:32:24 +0000 (13:32 +0800)]
librbd: always initialize local variables
silence warnings like:
src/librbd/io/ImageRequestWQ.cc:576:7: warning: 'length' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (block_overlapping_io(&m_in_flight_extents, offset, length)) {
^~
...
src/librbd/io/ImageRequestWQ.cc:935:12: note: 'length' was declared here
uint64_t length;
^~~~~~
Kefu Chai [Tue, 22 Oct 2019 06:18:10 +0000 (14:18 +0800)]
pybind/rados: do not use wait_for_safe() anymore
in librados, wait_for_safe() is an alias of wait_for_complete(). so in
this change, wait_for_safe() calls wait_for_complete(), and the callers
of wait_for_safe() will just call wait_for_complete(), instead of
calling both of them.
also, rados_aio_create_completion() is replaced with
rados_aio_create_completion2().
Kefu Chai [Tue, 22 Oct 2019 06:15:58 +0000 (14:15 +0800)]
librados: add rados_aio_create_completion2()
rados_aio_create_completion2() is almost identical to
rados_aio_create_completion(). the only difference is that the former
does not accept the `safe` callback. as it's an alias of `complete`
callback since af01db76f63a22178509b402776da54164af1eb0
Kefu Chai [Tue, 22 Oct 2019 06:10:16 +0000 (14:10 +0800)]
librados: mark wait_for_safe() functions deprecated
safe is an alias of completed since af01db76f63a22178509b402776da54164af1eb0. there is no need to have
two callbacks for tracking the state of an async operation anymore.
in this change, wait_for_safe() and friends are marked "deprecated"
Sage Weil [Wed, 30 Oct 2019 15:05:24 +0000 (10:05 -0500)]
ceph-daemon: use client.admin keyring during bootstrap
It's usually okay to use the mon. key for CLI commands, except we had a
mgr but that prevented you from issuing mgr commands correctly. We have
the new client.admin key available, so use that instead.
Update tests to not --skip-ssh (now that it doesn't hang).
Sage Weil [Wed, 30 Oct 2019 19:04:07 +0000 (14:04 -0500)]
Merge PR #31264 into master
* refs/pull/31264/head:
ceph-daemon: deal with lack of TemporaryDirectory on py2
ceph-daemon: make StringIO usage py2 compatible
ceph-daemon: make ConfigParser py2 compatible
Ilya Dryomov [Tue, 29 Oct 2019 15:19:14 +0000 (16:19 +0100)]
qa/suites/krbd: run unmap subsuite with msgr1 only
pre-single-major.yaml kernel doesn't have any of the monitor client
fixes that came in 4.6. If the connection is closed, it closes the
session and retries only after 10 seconds. On top of that, there is
nothing to prevent it from picking the same monitor when reconnecting.
This means that when given both v1 and v2 ports (which look like two
different monitors), it is susceptible to mount_timeout (60 seconds):
$ sudo rbd map img
rbd: sysfs write failed
In some cases useful info is found in syslog - try "dmesg | tail".
rbd: map failed: (5) Input/output error
[ 822.242313] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
[ 832.265494] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
[ 842.296175] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
[ 852.326924] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
[ 862.357611] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
[ 872.388373] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
[ 882.676136] libceph: mon0 172.21.15.132:3300 socket closed (con state CONNECTING)
Unlike newer kernels that return ETIMEDOUT, it returns EIO.
Newer kernels are much more aggressive about retries and will pick
a different monitor when reconnecting, hence they are always able to
establish the session in time.
Sage Weil [Wed, 30 Oct 2019 15:33:52 +0000 (10:33 -0500)]
ceph-daemon: make StringIO usage py2 compatible
Otherwise,
Traceback (most recent call last):
File "../src/ceph-daemon", line 1698, in <module>
r = args.func()
File "../src/ceph-daemon", line 767, in command_bootstrap
with StringIO() as f:
AttributeError: StringIO instance has no attribute '__exit__'
Nathan Cutler [Wed, 30 Oct 2019 13:30:08 +0000 (14:30 +0100)]
backport-resolve-issue: prune duplicate URLs
I have seen PR descriptions with a single backport tracker URL mentioned twice.
When backport-resolve-issue hit one of these, it would say:
Found backport tracker: https://tracker.ceph.com/issues/39272
Found backport tracker: https://tracker.ceph.com/issues/39272
-----------------------------------------------------------------
INFO:root:Tracker https://tracker.ceph.com/issues/39272 links to PR https://github.com/ceph/ceph/pull/29153
INFO:root:Backport Tracker 39272 target version already populated with correct value v12.2.13
INFO:root:Backport Tracker 39272 status is already set to Resolved
-----------------------------------------------------------------
INFO:root:Tracker https://tracker.ceph.com/issues/39272 links to PR https://github.com/ceph/ceph/pull/29153
INFO:root:Backport Tracker 39272 target version already populated with correct value v12.2.13
INFO:root:Backport Tracker 39272 status is already set to Resolved
=================================================================
Sage Weil [Tue, 29 Oct 2019 14:28:18 +0000 (09:28 -0500)]
mgr/telemetry: send device telemetry via per-host POST to device endpoint
We do not want to associate devices with clusters because that may
communicate unnecessary information about the association between vendors
and clusters (which, when large, are potentially identifying).
Instead, do a POST per host with all of the devices on that host only.
The devices endpoint does not log the POST time, so these per-host
records won't be associated with each other.
Jason Dillaman [Tue, 22 Oct 2019 13:11:34 +0000 (09:11 -0400)]
mgr: added placeholder 'osd' and 'mds' profiles
CephFS documents a previously unhandled profile named 'mds' that
needs to be accepted as valid (but currently provides no caps).
Similarly, the 'osd' cap is deployed in several scenarios as well.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 14 Oct 2019 16:34:35 +0000 (12:34 -0400)]
pybind/mgr: test session authorization against specific pools/namespaces
Use the optional "pool" and "namespace" constraints for the RBD cap
profiles to ensure the user has access to touch the specified
pool/namespace combo.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Mon, 14 Oct 2019 14:39:54 +0000 (10:39 -0400)]
mgr: python modules can now perform authorization tests
In cases where the python service or individual python modules are
enabled via caps, the module might want to perform finer grained
tests to ensure specific commands are allowed. An example of this is
the 'rbd_support' module limiting access by pools and namespaces.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Jason Dillaman [Fri, 11 Oct 2019 16:44:01 +0000 (12:44 -0400)]
mgr: support optional arguments for module and profile caps
This allows an optional, arbitrary key/value constraint clauses to
be appended to "profile XYZ" and "allow module XYZ" caps. A module
can then provide additional validatation against these meta-arguments.
Example:
profile rbd pool=rbd
allow module rbd_support with pool=rbd
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Sage Weil [Mon, 28 Oct 2019 19:59:43 +0000 (14:59 -0500)]
Merge PR #31168 into master
* refs/pull/31168/head:
ceph-daemon: try py2 import before py3
qa/suites/rados/singleton-nomsgr/ceph-daemon: make sure python3 is installed
qa/standalone/test_ceph_damon.sh: test with python2 and python3
mgr/ssh: python, not python3
ceph-daemon: python, not python3
ceph-daemon: os.makedirs
ceph-daemon: configparser is ConfigParser on py2
ceph-daemon: avoid py3-isms
Reviewed-by: Sebastian Wagner <swagner@suse.com> Reviewed-by: Alfredo Deza <adeza@redhat.com>