]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
4 years agoMerge pull request #40747 from smithfarm/wip-49731-nautilus
Yuri Weinstein [Tue, 27 Apr 2021 18:58:59 +0000 (11:58 -0700)]
Merge pull request #40747 from smithfarm/wip-49731-nautilus

nautilus: osd: do not dump an osd multiple times

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
4 years agoMerge pull request #40818 from rhcs-dashboard/wip-50172-nautilus
Ernesto Puerta [Tue, 27 Apr 2021 17:21:48 +0000 (19:21 +0200)]
Merge pull request #40818 from rhcs-dashboard/wip-50172-nautilus

nautilus: mgr/dashboard: debug nodeenv hangs

Reviewed-by: Waad Alkhoury <walkhour@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
4 years agoMerge pull request #39984 from aaSharma14/wip-49656-nautilus
Ernesto Puerta [Tue, 27 Apr 2021 17:18:59 +0000 (19:18 +0200)]
Merge pull request #39984 from aaSharma14/wip-49656-nautilus

nautilus: mgr/dashboard: test prometheus rules through promtool

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
4 years agoMerge pull request #41021 from rhcs-dashboard/wip-50417-nautilus
Ernesto Puerta [Tue, 27 Apr 2021 17:13:40 +0000 (19:13 +0200)]
Merge pull request #41021 from rhcs-dashboard/wip-50417-nautilus

nautilus: mgr/dashboard: filesystem pool size should use stored stat

Reviewed-by: Waad Alkhoury <walkhour@redhat.com>
Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
4 years agoMerge pull request #40650 from rhcs-dashboard/wip-50202-nautilus
Ernesto Puerta [Tue, 27 Apr 2021 17:12:59 +0000 (19:12 +0200)]
Merge pull request #40650 from rhcs-dashboard/wip-50202-nautilus

nautilus: mgr/dashboard: Revoke read-only user's access to Manager modules

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
4 years agoMerge pull request #40490 from aaSharma14/wip-50050-nautilus
Ernesto Puerta [Tue, 27 Apr 2021 17:12:17 +0000 (19:12 +0200)]
Merge pull request #40490 from aaSharma14/wip-50050-nautilus

nautilus: mgr/dashboard: Remove username, password fields from Manager Modules/dashboard,influx

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
4 years agoMerge pull request #40750 from smithfarm/wip-50122-nautilus
Yuri Weinstein [Tue, 27 Apr 2021 16:50:51 +0000 (09:50 -0700)]
Merge pull request #40750 from smithfarm/wip-50122-nautilus

nautilus:  crush/CrushLocation: do not print logging message in constructor

Reviewed-by: Kefu Chai <kchai@redhat.com>
4 years agoMerge pull request #40700 from smithfarm/wip-50130-nautilus
Yuri Weinstein [Tue, 27 Apr 2021 16:48:26 +0000 (09:48 -0700)]
Merge pull request #40700 from smithfarm/wip-50130-nautilus

nautilus: monmaptool: Don't call set_port on an invalid address

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
4 years agoMerge pull request #40676 from smithfarm/wip-49531-nautilus
Yuri Weinstein [Tue, 27 Apr 2021 16:47:30 +0000 (09:47 -0700)]
Merge pull request #40676 from smithfarm/wip-49531-nautilus

nautilus: mgr: add --max <n> to 'osd ok-to-stop' command

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
4 years agoMerge pull request #39903 from singuliere/wip-49376-nautilus
Yuri Weinstein [Tue, 27 Apr 2021 14:39:17 +0000 (07:39 -0700)]
Merge pull request #39903 from singuliere/wip-49376-nautilus

nautilus: cmake: build static libs if they are internal ones

Reviewed-by: Kefu Chai <kchai@redhat.com>
4 years agoMerge pull request #40709 from smithfarm/wip-49562-nautilus
Yuri Weinstein [Mon, 26 Apr 2021 23:55:05 +0000 (16:55 -0700)]
Merge pull request #40709 from smithfarm/wip-49562-nautilus

nautilus: qa: delete all fs during tearDown

Reviewed-by: Ramana Raja <rraja@redhat.com>
4 years agoMerge pull request #40704 from smithfarm/wip-49516-nautilus
Yuri Weinstein [Mon, 26 Apr 2021 23:54:36 +0000 (16:54 -0700)]
Merge pull request #40704 from smithfarm/wip-49516-nautilus

nautilus: pybind/cephfs: DT_REG and DT_LNK values are wrong

Reviewed-by: Ramana Raja <rraja@redhat.com>
4 years agoMerge pull request #40701 from smithfarm/wip-49473-nautilus
Yuri Weinstein [Mon, 26 Apr 2021 23:54:01 +0000 (16:54 -0700)]
Merge pull request #40701 from smithfarm/wip-49473-nautilus

nautilus: test: use std::atomic<bool> instead of volatile for cb_done var

Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
4 years agoMerge pull request #40714 from smithfarm/wip-49613-nautilus
Yuri Weinstein [Mon, 26 Apr 2021 22:31:52 +0000 (15:31 -0700)]
Merge pull request #40714 from smithfarm/wip-49613-nautilus

nautilus: qa: add sleep for blocklisting to take effect

Reviewed-by: Aishwarya Mathuria <amathuri@redhat.com>
4 years agomgr/dashboard: Revoke read-only user's access to Manager modules 40650/head
Nizamudeen A [Tue, 6 Apr 2021 15:54:51 +0000 (21:24 +0530)]
mgr/dashboard: Revoke read-only user's access to Manager modules

This will disable read only user to read/open Manager Modules page in
Ceph Dashboard where some of the security related informations are
shown.

Fixes: https://tracker.ceph.com/issues/50174
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit fb607f1561371340d2c9d4e16c4eaceb365fd926)

Conflicts:
src/pybind/mgr/dashboard/services/access_control.py
   - Some of the changes are not backported because those features are
     not implemented on nautilus. So I left them as it is

4 years agomgr/dashboard: filesystem pool size should use stored stat 41021/head
Avan Thakkar [Thu, 15 Apr 2021 13:28:52 +0000 (18:58 +0530)]
mgr/dashboard: filesystem pool size should use stored stat

Fixes: https://tracker.ceph.com/issues/50195
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Replaces 'bytes_used' with 'stored' stat to see the correct results
of CephFS pool stats.

(cherry picked from commit 7110fd4e0c257d20aa56591f05d74a2851a2fe00)

4 years agomgr/dashboard:Simplify some complex calculations in test_alerts.yml 39984/head
Aashish Sharma [Thu, 25 Mar 2021 05:55:37 +0000 (11:25 +0530)]
mgr/dashboard:Simplify some complex calculations in test_alerts.yml

run-promtool-unittests is failing with difference in floating point values in some complex calculations. This PR intends to simplify those calculations and fix this issue.

Fixes: https://tracker.ceph.com/issues/49952
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 8d2f39e6c568afb6880689160212bcc93057e194)

4 years agoceph.spec,install-deps: use golang-github-prometheus for promtools
Kefu Chai [Mon, 22 Mar 2021 06:07:54 +0000 (14:07 +0800)]
ceph.spec,install-deps: use golang-github-prometheus for promtools

instead of installing docker for using promtools, install
golang-github-prometheus.

Signed-off-by: Aashish Sharma <aasharma@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit e33e3a931db97d01318643ec686fe63fdd614082)

Conflicts:
ceph.spec.in (#287-295 new changes overrid these lines, merged correctly now)
install-deps.sh (changed dnf to yumdnf)

4 years agotest: run promtool test without docker on ubuntu/focal
Kefu Chai [Fri, 19 Mar 2021 02:32:16 +0000 (10:32 +0800)]
test: run promtool test without docker on ubuntu/focal

before this change, we use docker for running promtools offered by
a docker image, but this is not efficient, and quite a few developers
do not want to use docker for running "make check". this change was
introduced by #39246, the reason was that, in Ceph's CI process, we
are using Ubuntu/Bionic for running "make check" jobs, but prometheus
packaged by Bionic does not offer the "test rules" command. so, to
address problem, we are using "dnanexus/promtool:2.9.2" docker image
for verifying monitoring/prometheus/alerts/test_alerts.yml.

after this change, we use prometheus packaged by debian derivatives
instead of pulling a docker image.

* debian/control: add prometheus as a "make check" dependency
* install-deps.sh: partially revert
  53a5816deda0874a3a37e131e9bc22d88bb2a588, as we don't need to
  pull docker or start docker service for using promtool anymore.
* cmake: check if promtool is capable of running "test rules"
  command, bail out if it is not.

see also: https://tracker.ceph.com/issues/49653

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit f381aa8bf0e175940153975fa1534ef0559ecadd)

Conflicts:
debian/control (python-cherrypy3 conficts with python-cherrypy3 | python3-cherrypy3 in nautilus)
install-deps.sh (preload_wheels_for_tox method not in nautilus so removed that)
src/test/CMakeLists.txt (#561-594 new changes overrid these lines, merged correctly now)

4 years agomgr/dashboard:test prometheus rules through promtool
Aashish Sharma [Wed, 3 Feb 2021 07:23:56 +0000 (12:53 +0530)]
mgr/dashboard:test prometheus rules through promtool

This PR intends to add unit testing for prometheus rules using promtool. To run the tests run 'run-promtool-unittests.sh' file.

Fixes: https://tracker.ceph.com/issues/45415
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 53a5816deda0874a3a37e131e9bc22d88bb2a588)

Conflicts:
install-deps.sh (changed dnf to yumdnf , preload_wheels method not in nautilus so removed that)
src/test/CMakeLists.txt (#561-594 new changes overrid these lines, merged correctly now)

4 years agomgr/dashboard: Remove username, password fileds from -Cluster/Manager Modules/dashboard 40490/head
Aashish Sharma [Mon, 8 Mar 2021 09:44:00 +0000 (15:14 +0530)]
mgr/dashboard: Remove username, password fileds from -Cluster/Manager Modules/dashboard

Username, password fields are empty in Cluster/Manager Modules/dashboard.Since this functionality is when dashboard supported single user-password, now we need to remove these fields from here.

Fixes: https://tracker.ceph.com/issues/49645
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit d8fba40d982bb1ad824961aa210475bd7aa51524)

Conflicts:
src/pybind/mgr/dashboard/services/access_control.py(no check_migrate_v0_to_current and check_migrate_v1_to_current methods in nautilus)
src/pybind/mgr/dashboard/tests/test_access_control.py(no test_load_v2 method in nautilus, 'time' import no longer needed with new changes)

4 years agoMerge pull request #40959 from rhcs-dashboard/wip-50459-nautilus
Ernesto Puerta [Wed, 21 Apr 2021 13:56:46 +0000 (15:56 +0200)]
Merge pull request #40959 from rhcs-dashboard/wip-50459-nautilus

nautilus: vstart.sh: disable "auth_allow_insecure_global_id_reclaim"

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
4 years agovstart.sh: disable "auth_allow_insecure_global_id_reclaim" 40959/head
Kefu Chai [Thu, 15 Apr 2021 13:07:53 +0000 (21:07 +0800)]
vstart.sh: disable "auth_allow_insecure_global_id_reclaim"

to silence the health warning of "mons are allowing insecure global_id
reclaim", which prevents the cluster from being active+clean. couple
tests are expecting a warning free cluster before they starts.

as this option is enabled by default for appeasing the old clients, but when it
comes to most of upstream testing, we can just disable it.

Fixes: https://tracker.ceph.com/issues/50374
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 77a8376d0731c24e7bbf24523d3d7450e9f978af)

4 years agoMerge pull request #40270 from kotreshhr/wip-49903-nautilus
Yuri Weinstein [Tue, 20 Apr 2021 18:11:55 +0000 (11:11 -0700)]
Merge pull request #40270 from kotreshhr/wip-49903-nautilus

nautilus: mgr/volumes: Retain suid guid bits in clone

Reviewed-by: Ramana Raja <rraja@redhat.com>
4 years agoMerge branch 'nautilus-saved' into nautilus
Ilya Dryomov [Tue, 20 Apr 2021 08:56:25 +0000 (10:56 +0200)]
Merge branch 'nautilus-saved' into nautilus

4 years ago14.2.20 v14.2.20
Jenkins Build Slave User [Mon, 19 Apr 2021 14:11:15 +0000 (14:11 +0000)]
14.2.20

4 years agoauth/cephx: make KeyServer::build_session_auth_info() less confusing
Ilya Dryomov [Thu, 15 Apr 2021 13:18:58 +0000 (15:18 +0200)]
auth/cephx: make KeyServer::build_session_auth_info() less confusing

The second KeyServer::build_session_auth_info() overload is used only
by the monitor, for mon <-> mon authentication.  The monitor passes in
service_secret (mon secret) and secret_id (-1).  The TTL is irrelevant
because there is no rotation.

However the signature doesn't make it obvious.  Clarify that
service_secret and secret_id are input parameters and info is the only
output parameter.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 6f12cd3688b753633c8ff29fb3bd64758f960b2b)

4 years agoauth/cephx: cap ticket validity by expiration of "next" key
Ilya Dryomov [Thu, 15 Apr 2021 07:48:13 +0000 (09:48 +0200)]
auth/cephx: cap ticket validity by expiration of "next" key

If auth_mon_ticket_ttl is increased by several times as done in
commit 522a52e6c258 ("auth/cephx: rotate auth tickets less often"),
active clients eventually get stuck because the monitor sends out an
auth ticket with a bogus validity.  The ticket is secured with the
"current" secret that is scheduled to expire according to the old TTL,
but the validity of the ticket is set to the new TTL.  As a result,
the client simply doesn't attempt to renew, letting the secrets rotate
potentially more than once.  When that happens, the client first hits
auth authorizer errors as it tries to renew service tickets and when
it finally gets to renewing the auth ticket, it hits the insecure
global_id reclaim wall.

Cap TTL by expiration of "next" key -- the "current" key may be
milliseconds away from expiration and still be used, legitimately.
Do it in KeyServerData alongside key rotation code and propagate the
capped TTL to the upper layer.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 370c9b13970d47a55b1b20ef983c6f01236c9565)

Conflicts:
src/auth/cephx/CephxKeyServer.cc [ commit ef3c42cd6481 ("auth:
  EACCES, not EPERM") not in nautilus ]

4 years agoauth/cephx: drop redundant KeyServerData::get_service_secret() overload
Ilya Dryomov [Thu, 15 Apr 2021 07:47:50 +0000 (09:47 +0200)]
auth/cephx: drop redundant KeyServerData::get_service_secret() overload

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 3078af716505ae754723864786a41a6d6af0534c)

4 years agomgr/dashboard: debug nodeenv hangs 40818/head
Ernesto Puerta [Tue, 6 Apr 2021 11:45:15 +0000 (13:45 +0200)]
mgr/dashboard: debug nodeenv hangs

Increase verbosity in nodeenv command for debugging purposes.

Fixes: https://tracker.ceph.com/issues/50044
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
(cherry picked from commit 2c2a397f84455147e1cc5c7b5fc1289e47bbe5ee)

 Conflicts:
make-dist
src/pybind/mgr/dashboard/CMakeLists.txt
      - Adopted the master branch changes.

4 years agomgr/volumes: Retain suid/guid bits in subvolume clone 40270/head
Kotresh HR [Thu, 18 Mar 2021 12:54:44 +0000 (18:24 +0530)]
mgr/volumes: Retain suid/guid bits in subvolume clone

Fixes: https://tracker.ceph.com/issues/49882
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 92dc982318fa7d49c3185615b84a7a7764c6ed42)

Conflicts:
  qa/tasks/cephfs/test_volumes.py: Few of the testcases are not preset
      in octopus, hence the conflicts.

4 years agopybind/cephfs: Add lchmod python binding
Kotresh HR [Thu, 18 Mar 2021 12:51:05 +0000 (18:21 +0530)]
pybind/cephfs: Add lchmod python binding

Fixes: https://tracker.ceph.com/issues/49882
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit b2375adce085e98bef521422441b80a945e38c80)

Conflicts:
  src/pybind/cephfs/mock_cephfs.pxi : Not present in octopus
  src/pybind/cephfs/c_cephfs.pxd : Not present in octopus
  src/pybind/cephfs/cephfs.pyx : Few of the fops is not part of octopus
      which got pulled as part of this backport
  src/test/pybind/test_cephfs.py :  Few of the fops is not part of
      octopus, which got pulled as part of this backport. Added missing
      stat import.

4 years agoclient/libcephfs: Add lchmod
Kotresh HR [Thu, 18 Mar 2021 12:51:05 +0000 (18:21 +0530)]
client/libcephfs: Add lchmod

Fixes: https://tracker.ceph.com/issues/49882
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit bb1fd87e3bc45b20f377438cddde6c6307299a29)

4 years agoqa/standalone: default to disable insecure global id reclaim
Sage Weil [Sun, 28 Mar 2021 22:07:57 +0000 (18:07 -0400)]
qa/standalone: default to disable insecure global id reclaim

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 72c4fc75ad301980baebc7789ed6391444057e5b)

4 years agoqa/tasks/ceph[adm].conf[.template]: disable insecure global_id reclaim health alerts
Sage Weil [Fri, 26 Mar 2021 22:08:46 +0000 (18:08 -0400)]
qa/tasks/ceph[adm].conf[.template]: disable insecure global_id reclaim health alerts

Turn these off everywhere for our tests so they don't interfere with our health checks.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 9f6fd4fe563c9cd4cf65316921d511b677c972e4)

Conflicts:
qa/tasks/cephadm.conf [ no cephadm in nautilus ]

4 years agomon/HealthMonitor: raise AUTH_INSECURE_GLOBAL_ID_RENEWAL[_ALLOWED]
Sage Weil [Thu, 25 Mar 2021 22:07:53 +0000 (18:07 -0400)]
mon/HealthMonitor: raise AUTH_INSECURE_GLOBAL_ID_RENEWAL[_ALLOWED]

Two new alerts:

- AUTH_INSECURE_GLOBAL_ID_RENEWAL_ALLOWED if we are allowing clients to reclaim
global_ids in an insecure manner (for backwards compatibility until
clients are upgraded)

- AUTH_INSECURE_GLBOAL_ID_RENEWAL if there are currently clients connected that
do not know how to securely renew their global_id, as exposed by
auth_expose_insecure_global_id_reclaim=true.  The client auth names and IPs
are listed the alert details (up to a limit, at least).

The docs recommend operators mute these alerts instead of silencing, but
we still include option that allow the alerts to be disabled entirely.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 18b343b06e5dd904af425dc99e2c848e12f3b552)

Conflicts:
doc/rados/operations/health-checks.rst [ MON_DISK_* alerts
  present but not documented in nautilus; "ceph health mute"
  not in nautilus -- silencing temporarily is not possible ]
src/mon/HealthMonitor.cc [ commits e4bf716bfa07 ("mon: store
  a reference as member variable") and d0eb22f3ba55
  ("mon/health_checks: associate a count with health_alert_t")
  not in nautilus ]

4 years agoauth/cephx: ignore CEPH_ENTITY_TYPE_AUTH in requested keys
Ilya Dryomov [Tue, 2 Mar 2021 14:09:26 +0000 (15:09 +0100)]
auth/cephx: ignore CEPH_ENTITY_TYPE_AUTH in requested keys

When handling CEPHX_GET_AUTH_SESSION_KEY requests from nautilus+
clients, ignore CEPH_ENTITY_TYPE_AUTH in CephXAuthenticate::other_keys.
Similarly, when handling CEPHX_GET_PRINCIPAL_SESSION_KEY requests,
ignore CEPH_ENTITY_TYPE_AUTH in CephXServiceTicketRequest::keys.
These fields are intended for requesting service tickets, the auth
ticket (which is really a ticket granting ticket) must not be shared
this way.

Otherwise we end up sharing an auth ticket that a) isn't encrypted
with the old session key even if needed (should_enc_ticket == true)
and b) has the wrong validity, namely auth_service_ticket_ttl instead
of auth_mon_ticket_ttl.  In the CEPHX_GET_AUTH_SESSION_KEY case, this
undue ticket immediately supersedes the actual auth ticket already
encoded in the same reply (the reply frame ends up containing two auth
tickets).

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 05772ab6127bdd9ed2f63fceef840f197ecd9ea8)

4 years agoauth/cephx: rotate auth tickets less often
Ilya Dryomov [Mon, 22 Mar 2021 18:16:32 +0000 (19:16 +0100)]
auth/cephx: rotate auth tickets less often

If unauthorized global_id (re)use is disallowed, a client that has
been disconnected from the network long enough for keys to rotate
and its auth ticket to expire (i.e. become invalid/unverifiable)
would not be able to reconnect.

The default TTL is 12 hours, resulting in a 12-24 hour reconnect
window (the previous key is kept around, so the actual window can be
up to double the TTL).  The setting has stayed the same since 2009,
but it also hasn't been enforced.  Bump it to get a 72 hour reconnect
window to cover for something breaking on Friday and not getting fixed
until Monday.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 522a52e6c258932274f0753feb623ce008519216)

4 years agomon: fail fast when unauthorized global_id (re)use is disallowed
Ilya Dryomov [Thu, 25 Mar 2021 19:59:13 +0000 (20:59 +0100)]
mon: fail fast when unauthorized global_id (re)use is disallowed

When unauthorized global_id (re)use is disallowed, we don't want to
let unpatched clients in because they wouldn't be able to reestablish
their monitor session later, resulting in subtle hangs and disrupted
user workloads.

Denying the initial connect for all legacy (CephXAuthenticate < v3)
clients is not feasible because a large subset of them never stopped
presenting their ticket on reconnects and are therefore compatible with
enforcing mode: most notably all kernel clients but also pre-luminous
userspace clients.  They don't need to be patched and excluding them
would significantly hamper the adoption of enforcing mode.

Instead, force clients that we are not sure about to reconnect shortly
after they go through authentication and obtain global_id.  This is
done in Monitor::dispatch_op() to capture both msgr1 and msgr2, most
likely instead of dispatching mon_subscribe.

We need to let mon_getmap through for "ceph ping" and "ceph tell" to
work.  This does mean that we share the monmap, which lets the client
return from MonClient::authenticate() considering authentication to be
finished and causing the potential reconnect error to not propagate to
the user -- the client would hang waiting for remaining cluster maps.
For msgr1, this is unavoidable because the monmap is sent immediately
after the final MAuthReply.  But for msgr2 this is rare: most of the
time we get to their mon_subscribe and cut the connection before they
process the monmap!

Regardless, the user doesn't get a chance to start a workload since
there is no proper higher-level session at that point.

To help with identifying clients that need patching, add global_id and
global_id_status to "sessions" output.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 08766a17edebb7450cd9b17cc2dc01efc068bb94)

Conflicts:
src/mon/Monitor.cc [ commit e1163b445bbf ("mon: print
  entity_name along with caps to debug log") not in nautilus ]

4 years agoauth/cephx: option to disallow unauthorized global_id (re)use
Ilya Dryomov [Sat, 13 Mar 2021 13:53:52 +0000 (14:53 +0100)]
auth/cephx: option to disallow unauthorized global_id (re)use

global_id is a cluster-wide unique id that must remain stable for the
lifetime of the client instance.  The cephx protocol has a facility to
allow clients to preserve their global_id across reconnects:

(1) the client should provide its global_id in the initial handshake
    message/frame and later include its auth ticket proving previous
    possession of that global_id in CEPHX_GET_AUTH_SESSION_KEY request

(2) the monitor should verify that the included auth ticket is valid
    and has the same global_id and, if so, allow the reclaim

(3) if the reclaim is allowed, the new auth ticket should be
    encrypted with the session key of the included auth ticket to
    ensure authenticity of the client performing reclaim.  (The
    included auth ticket could have been snooped when the monitor
    originally shared it with the client or any time the client
    provided it back to the monitor as part of requesting service
    tickets, but only the genuine client would have its session key
    and be able to decrypt.)

Unfortunately, all (1), (2) and (3) have been broken for a while:

- (1) was broken in 2016 by commit a2eb6ae3fb57 ("mon/monclient:
  hunt for multiple monitor in parallel") and is addressed in patch
  "mon/MonClient: preserve auth state on reconnects"

- it turns out that (2) has never been enforced.  When cephx was
  being designed and implemented in 2009, two changes to the protocol
  raced with each other pulling it in different directions: commits
  0669ca21f4f7 ("auth: reuse global_id when requesting tickets")
  and fec31964a12b ("auth: when renewing session, encrypt ticket")
  added the reclaim mechanism based strictly on auth tickets, while
  commit 5eeb711b6b2b ("auth: change server side negotiation a bit")
  allowed the client to provide global_id in the initial handshake.
  These changes didn't get reconciled and as a result a malicious
  client can assign itself any global_id of its choosing by simply
  passing something other than 0 in MAuth message or AUTH_REQUEST
  frame and not even bother supplying any ticket.  This includes
  getting a global_id that is being used by another client.

- (3) was broken in 2019 with addition of support for msgr2, where
  the new auth ticket ends up being shared unencrypted.  However the
  root cause is deeper and a malicious client can coerce msgr1 into
  the same.  This also goes back to 2009 and is addressed in patch
  "auth/cephx: ignore CEPH_ENTITY_TYPE_AUTH in requested keys".

Because (2) has never been enforced, no one noticed when (1) got
broken and we began to rely on this flaw for normal operation in
the face of reconnects due to network hiccups or otherwise.  As of
today, only pre-luminous userspace clients and kernel clients are
not exercising it on a daily basis.

Bump CephXAuthenticate version and use a dummy v3 to distinguish
between legacy clients that don't (may not) include their auth ticket
and new clients.  For new clients, unconditionally disallow claiming
global_id without a corresponding auth ticket.  For legacy clients,
introduce a choice between permissive (current behavior, default for
the foreseeable future) and enforcing mode.

If the reclaim is disallowed, return EACCES.  While MonClient does
have some provision for global_id changes and we could conceivably
implement enforcement by handing out a fresh global_id instead of
the provided one, those code paths have never been tested and there
are too many ways a sudden global_id change could go wrong.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit abebd643cc60fa8a7cb82dc29a9d5041fb3c3d36)

Conflicts:
src/auth/AuthServiceHandler.h [ bufferlist vs
  ceph::buffer::list ]
src/auth/cephx/CephxProtocol.h [ ditto ]
src/auth/cephx/CephxServiceHandler.h [ ditto ]
src/auth/none/AuthNoneServiceHandler.h [ ditto ]

4 years agoauth/cephx: make cephx_decode_ticket() take a const ticket_blob
Ilya Dryomov [Tue, 30 Mar 2021 09:10:17 +0000 (11:10 +0200)]
auth/cephx: make cephx_decode_ticket() take a const ticket_blob

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 6b860684c6e59b11c727206819805f89f0518575)

4 years agoauth/AuthServiceHandler: keep track of global_id and whether it is new
Ilya Dryomov [Tue, 9 Mar 2021 15:33:55 +0000 (16:33 +0100)]
auth/AuthServiceHandler: keep track of global_id and whether it is new

AuthServiceHandler already has global_id field, but it is unused.
Revive it and let the handler know whether global_id is newly assigned
by the monitor or provided by the client.

Lift the setting of entity_name into AuthServiceHandler.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit b50b6abd60e730176a7ef602bdd25d789a3c467d)

Conflicts:
src/auth/AuthServiceHandler.h [ bufferlist vs
  ceph::buffer::list ]
src/auth/cephx/CephxServiceHandler.cc [ ditto ]
src/auth/cephx/CephxServiceHandler.h [ ditto ]
src/auth/none/AuthNoneServiceHandler.h [ ditto ]

4 years agoauth/AuthServiceHandler: build_cephx_response_header() is cephx-specific
Ilya Dryomov [Tue, 9 Mar 2021 13:36:39 +0000 (14:36 +0100)]
auth/AuthServiceHandler: build_cephx_response_header() is cephx-specific

Make the one in CephxServiceHandler private and drop the stub in
AuthNoneServiceHandler.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 49cba02a750d4c1ab68399401f0c04f9c9be5b9e)

Conflicts:
src/auth/cephx/CephxServiceHandler.h [ bufferlist vs
  ceph::buffer::list ]
src/auth/none/AuthNoneServiceHandler.h [ ditto ]

4 years agoauth/AuthServiceHandler: drop unused start_session() args
Ilya Dryomov [Tue, 9 Mar 2021 13:25:39 +0000 (14:25 +0100)]
auth/AuthServiceHandler: drop unused start_session() args

session_key, connection_secret and connection_secret_required_length
aren't material for start_session() across all three implementations.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit c151c9659bdb71f30b520bbd62f91cc009ec51cd)

Conflicts:
src/auth/AuthServiceHandler.h [ bufferlist vs
  ceph::buffer::list ]
src/auth/cephx/CephxServiceHandler.h [ ditto ]
src/auth/none/AuthNoneServiceHandler.h [ ditto ]

4 years agomon/MonClient: drop global_id arg from _add_conn() and _add_conns()
Ilya Dryomov [Tue, 30 Mar 2021 13:19:41 +0000 (15:19 +0200)]
mon/MonClient: drop global_id arg from _add_conn() and _add_conns()

Passing anything but MonClient instance's global_id doesn't make
sense.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit a71f6e90d43cca5a79db92ca6a640598796ae7ee)

Conflicts:
src/mon/MonClient.cc [ commit 1e9b18008c5e ("mon: set
  MonClient::_add_conn return type to void") not in nautilus ]
src/mon/MonClient.h [ ditto ]

4 years agomon/MonClient: reset auth state in shutdown()
Ilya Dryomov [Thu, 1 Apr 2021 08:55:36 +0000 (10:55 +0200)]
mon/MonClient: reset auth state in shutdown()

Destroying AuthClientHandler and not resetting global_id is another
way to get MonClient to send CEPHX_GET_AUTH_SESSION_KEY requests with
CephXAuthenticate::old_ticket not populated.  This is particularly
pertinent to get_monmap_and_config() which shuts down the bootstrap
MonClient between retry attempts.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit c9b022e07392979e7f9ea6c11484a7dd872cc235)

4 years agomon/MonClient: preserve auth state on reconnects
Ilya Dryomov [Mon, 8 Mar 2021 14:37:02 +0000 (15:37 +0100)]
mon/MonClient: preserve auth state on reconnects

Commit a2eb6ae3fb57 ("mon/monclient: hunt for multiple monitor in
parallel") introduced a regression where auth state (global_id and
AuthClientHandler) was no longer preserved on reconnects.  The ensuing
breakage was quickly noticed and prompted a follow-on fix 8bb6193c8f53
("mon/MonClient: persist global_id across re-connecting").

However, as evident from the subject, the follow-on fix only took
care of the global_id part.  AuthClientHandler is still destroyed
and all cephx tickets are discarded.  A new from-scratch instance
is created for each MonConnection and CEPHX_GET_AUTH_SESSION_KEY
requests end up with CephXAuthenticate::old_ticket not populated.
The bug is in MonClient, so both msgr1 and msgr2 are affected.

This should have resulted in a similar sort of breakage but didn't
because of a much larger bug.  The monitor should have denied the
attempt to reclaim global_id with no valid ticket proving previous
possession of that global_id presented.  Alas, it appears that this
aspect of the cephx protocol has never been enforced.  This is dealt
with in the next patch.

To fix the issue at hand, clone AuthClientHandler into each
MonConnection so that each respective CEPHX_GET_AUTH_SESSION_KEY
request gets a copy of the current auth ticket.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 236b536b28482ec9d8b872de03da7d702ce4787b)

Conflicts:
src/mon/MonClient.cc [ commit 1e9b18008c5e ("mon: set
  MonClient::_add_conn return type to void") not in nautilus ]

4 years agomon/MonClient: claim active_con's auth explicitly
Ilya Dryomov [Sat, 6 Mar 2021 10:15:40 +0000 (11:15 +0100)]
mon/MonClient: claim active_con's auth explicitly

Eliminate confusion by moving auth from active_con into MonClient
instead of swapping them.

The existing MonClient::auth can be destroyed right away -- I don't
see why active_con would need it or a reason to delay its destruction
(which is what stashing in active_con effectively does).

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit eec24e4d119c57c7eb5119dc0083616a61b33b89)

4 years agomon: dump json from 'sessions' asok/tell command
Sage Weil [Wed, 29 Jan 2020 21:37:03 +0000 (15:37 -0600)]
mon: dump json from 'sessions' asok/tell command

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 71a0d8a568bd0034cc1e6329cd20269f11635697)

Conflicts:
src/mon/Monitor.cc [ commit adf1486e46cb ("common/admin_socket:
  pass Formatter from generic infrastructure") not in nautilus ]

4 years agoqa/tasks/ceph.conf: shorten cephx TTL for testing 40661/head
Sage Weil [Mon, 5 Apr 2021 18:08:30 +0000 (13:08 -0500)]
qa/tasks/ceph.conf: shorten cephx TTL for testing

Rotate tickets frequently to exercise those code paths during testing.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 94df76244798cdc0bafd74c9e5197adb5aa990c0)

Conflicts:
qa/tasks/cephadm.conf [ no cephadm in nautilus ]

4 years agoMerge pull request #40359 from tchaikov/nautilus-pr-39937
Yuri Weinstein [Mon, 12 Apr 2021 15:23:40 +0000 (08:23 -0700)]
Merge pull request #40359 from tchaikov/nautilus-pr-39937

nautilus: mgr: add mon metada using type of "mon"

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
4 years agoMerge pull request #39397 from kamoltat/wip-nautilus-del-period-arg
Yuri Weinstein [Mon, 12 Apr 2021 15:22:34 +0000 (08:22 -0700)]
Merge pull request #39397 from kamoltat/wip-nautilus-del-period-arg

nautilus: qa/tasks/mgr/test_progress: fix wait_until_equal

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
4 years agoMerge pull request #40619 from smithfarm/wip-50164-nautilus
Yuri Weinstein [Mon, 12 Apr 2021 15:21:30 +0000 (08:21 -0700)]
Merge pull request #40619 from smithfarm/wip-50164-nautilus

nautilus: cmake: set empty RPATH for some test executables

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
4 years agoMerge pull request #40393 from neha-ojha/wip-49966-nautilus
Yuri Weinstein [Mon, 12 Apr 2021 15:21:05 +0000 (08:21 -0700)]
Merge pull request #40393 from neha-ojha/wip-49966-nautilus

nautilus: common/options: bluefs_buffered_io=true by default

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
4 years agoMerge pull request #40675 from smithfarm/wip-49768-nautilus
Yuri Weinstein [Mon, 12 Apr 2021 15:18:36 +0000 (08:18 -0700)]
Merge pull request #40675 from smithfarm/wip-49768-nautilus

nautilus: librbd: allow interrupted trash move request to be restarted

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
4 years agoMerge pull request #40567 from singuliere/wip-49991-nautilus
Yuri Weinstein [Mon, 12 Apr 2021 15:18:00 +0000 (08:18 -0700)]
Merge pull request #40567 from singuliere/wip-49991-nautilus

nautilus: common/mempool: only fail tests if sharding is very bad

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
4 years agoMerge pull request #40549 from idryomov/wip-remove-log-early-nautilus
Yuri Weinstein [Mon, 12 Apr 2021 15:17:33 +0000 (08:17 -0700)]
Merge pull request #40549 from idryomov/wip-remove-log-early-nautilus

nautilus: common: remove log_early configuration option

Reviewed-by: Sage Weil <sage@redhat.com>
4 years agocrush/CrushLocation: do not print logging message in constructor 40750/head
Alex Wu [Mon, 29 Mar 2021 02:09:50 +0000 (22:09 -0400)]
crush/CrushLocation: do not print logging message in constructor

do not use logging facility in constructor, as CephContext::_log is set
after CephContext::crush_location is created in constructor of CephContext.

Fixes: https://tracker.ceph.com/issues/50047
Signed-off-by: Alex Wu <notmycupoftea@163.com>
(cherry picked from commit 68812a2a4f63e9fd7c33f14b7a00c54a6a21128e)

Conflicts:
src/crush/CrushLocation.cc
- trivial resolution

4 years agoosd: ignore already dumped osd in dump_item() 40747/head
jhonxue [Fri, 5 Mar 2021 15:33:10 +0000 (23:33 +0800)]
osd: ignore already dumped osd in dump_item()

Fixes: https://tracker.ceph.com/issues/49627
Signed-off-by: Xue Yantao <jhonxue@tencent.com>
(cherry picked from commit 7813819445e73d1e7f333bd9aaaf42624cd781ec)

4 years agoMerge pull request #40674 from smithfarm/wip-50158-nautilus
Yuri Weinstein [Fri, 9 Apr 2021 14:49:52 +0000 (07:49 -0700)]
Merge pull request #40674 from smithfarm/wip-50158-nautilus

nautilus: test/rgw: test_datalog_autotrim filters out new entries

Reviewed-by: Casey Bodley <cbodley@redhat.com>
4 years agoMerge pull request #40671 from smithfarm/wip-50095-nautilus
Yuri Weinstein [Fri, 9 Apr 2021 14:49:26 +0000 (07:49 -0700)]
Merge pull request #40671 from smithfarm/wip-50095-nautilus

nautilus: rgw: return error when trying to copy encrypted object without key

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
4 years agoMerge pull request #40670 from smithfarm/wip-49744-nautilus
Yuri Weinstein [Fri, 9 Apr 2021 14:48:57 +0000 (07:48 -0700)]
Merge pull request #40670 from smithfarm/wip-49744-nautilus

nautilus: rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1

Reviewed-by: Casey Bodley <cbodley@redhat.com>
4 years agoMerge pull request #40668 from smithfarm/wip-50233-nautilus
Yuri Weinstein [Fri, 9 Apr 2021 14:48:27 +0000 (07:48 -0700)]
Merge pull request #40668 from smithfarm/wip-50233-nautilus

nautilus: rgw: return ERR_NO_SUCH_BUCKET early while evaluating bucket policy

Reviewed-by: Matt Benjamin <mbenjami@redhat.com>
4 years agoqa: add sleep for blocklisting to take effect 40714/head
Patrick Donnelly [Tue, 16 Feb 2021 21:27:16 +0000 (13:27 -0800)]
qa: add sleep for blocklisting to take effect

Fixes: https://tracker.ceph.com/issues/49318
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 061eab77136767eb7e8df214ae9e408447f92b33)

Conflicts:
qa/suites/fs/upgrade/featureful_client/old_client/tasks/3-compat_client/mimic.yaml
- trivial resolution
qa/suites/fs/upgrade/featureful_client/upgraded_client/tasks/4-compat_client.yaml
- trivial resolution

4 years agoqa: delete all fs during tearDown 40709/head
Patrick Donnelly [Fri, 26 Feb 2021 17:13:21 +0000 (09:13 -0800)]
qa: delete all fs during tearDown

During the ceph task Unwind, the MDS are stopped. If any file system
still exists, we will see failover messages in the cluster log.

Fixes: https://tracker.ceph.com/issues/49510
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 4e6d9e6a0484357d483fb1a183d1bfbcc33b021a)

Conflicts:
qa/tasks/cephfs/cephfs_test_case.py
- trivial resolution

4 years agopybind/cephfs: DT_REG and DT_LNK values are wrong 40704/head
Varsha Rao [Wed, 24 Feb 2021 11:16:47 +0000 (16:46 +0530)]
pybind/cephfs: DT_REG and DT_LNK values are wrong

DT_REG and DT_LNK don't match with values defined in
/usr/include/dirent.h

define DT_REG 8
define DT_LNK 10

This patch corrects them.

Fixes: https://tracker.ceph.com/issues/49459
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit 91e2275f4cd6a72bc3a78418236db009f5c9c547)

4 years agotest: use std::atomic<bool> instead of volatile for cb_done var 40701/head
Jeff Layton [Tue, 16 Feb 2021 17:59:40 +0000 (12:59 -0500)]
test: use std::atomic<bool> instead of volatile for cb_done var

Fixes: https://tracker.ceph.com/issues/49309
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit 4380af3074bb91714b1cf6b7a99210b64f773ba7)

4 years agomonmaptool: Don't call set_port on an invalid address 40700/head
Brad Hubbard [Wed, 25 Nov 2020 01:57:37 +0000 (11:57 +1000)]
monmaptool: Don't call set_port on an invalid address

Verify we parse the entire address argument.

Fixes: https://tracker.ceph.com/issues/48336
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit c0aa1fdbe7b87c2fb4b572169372ec487950b03d)

4 years agodoc/man/8/ceph: document --max option 40676/head
Sage Weil [Tue, 23 Feb 2021 15:56:24 +0000 (10:56 -0500)]
doc/man/8/ceph: document --max option

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 98f1be85d9f329588cf8e21d7b49ceb0b07425fe)

4 years agosrc/test/osd/safe-to-destroy: adjust test
Sage Weil [Mon, 22 Feb 2021 23:01:35 +0000 (18:01 -0500)]
src/test/osd/safe-to-destroy: adjust test

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 2e156079c8b6cd7c6ab040567545a1d8a5e4ae2b)

4 years agoceph: print command output to stdout even on error
Sage Weil [Sat, 20 Feb 2021 16:58:47 +0000 (11:58 -0500)]
ceph: print command output to stdout even on error

Currently in the case where the mon returns a command error code, we print
the error stream and Error ... message but not the command output.  Usually
there isn't any, so we haven't noticed until now, but there is not reason
why shouldn't return both an error code and some output.

Restructure the code so that the error message goes *after* the JSON output,
where it will be a bit more obvious to the user (if the stdout scrolled
the terminal, for instance).  (This is not a change in behavior since
previously we weren't seeing the stdout at all.)

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 9425eee579adc2408602fb1734dc5aecf58ee4f2)

Conflicts:
src/ceph.in
- nautilus has to support Python 2, so preserve the "u" prefix on the string
  literal

4 years agomgr/DaemonServer: include details in 'osd ok-to-stop' output
Sage Weil [Sat, 20 Feb 2021 17:26:01 +0000 (12:26 -0500)]
mgr/DaemonServer: include details in 'osd ok-to-stop' output

Include specifics about which pgs are affect, which pgs prevent us from
being ok to stop, etc.

The primary downside I see here is that a success and failure output will
look more similar to a human user

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 791952cc01201010f298033003ba52374cc0159f)

Conflicts:
        src/mgr/DaemonServer.cc
- in nautilus, cmd_getval() call needs an extra argument

4 years agomgr: add --max <n> to 'osd ok-to-stop' command
Sage Weil [Sat, 20 Feb 2021 14:53:51 +0000 (09:53 -0500)]
mgr: add --max <n> to 'osd ok-to-stop' command

Given and initial (set of) osd(s), if provide up to N OSDs that can be
stopped together without making PGs become unavailable.

This can be used to quickly identify large(r) batches of OSDs that can be
stopped together to (for example) upgrade.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 722f57dee1306007c9059711a93b445bbd9079ec)

Conflicts:
        src/mgr/DaemonServer.cc
- in nautilus, cmd_getval() call requires g_ceph_context as first variable

4 years agomgr: relax osd ok-to-stop condition on degraded pgs
Xuehan Xu [Sun, 7 Feb 2021 04:40:36 +0000 (12:40 +0800)]
mgr: relax osd ok-to-stop condition on degraded pgs

Right now, the "ok-to-stop" condition is relatively rigorous, it allows
stopping an osd only if no PG on it is non-active or degraded. But there
are situations in which an OSD is part of a degraded pg and the pg still
still have > min_size complete replicas after the OSD is stopped.

In 9750061d5d4236aaba156d60790e0b8bcd7cfb64, we changed from considering
just acting to using avail_no_missing (OSDs that have no missing objects).
When the projected pg_acting is constructed this way, we can safely compare
to min_size... even for a PG marked degraded.

Fixes: https://tracker.ceph.com/issues/49392
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
(cherry picked from commit 2f28fc58eb63e20c2a869f5407516cf8044dbc41)

4 years agorbd: clarify trash remove error code from interrupted move 40675/head
Jason Dillaman [Wed, 10 Mar 2021 20:31:22 +0000 (15:31 -0500)]
rbd: clarify trash remove error code from interrupted move

Fixes: https://tracker.ceph.com/issues/49716
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 138d71fb0635682510cadda8e4ad5aaab3f39e44)

4 years agolibrbd/trash: don't return -ENOENT error from move state machine
Jason Dillaman [Wed, 10 Mar 2021 20:37:39 +0000 (15:37 -0500)]
librbd/trash: don't return -ENOENT error from move state machine

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit f6ed98d682e562de1cad301696e918c52a4dba5d)

4 years agolibrbd/api: trash remove/purge should indicate interrupted move
Jason Dillaman [Wed, 10 Mar 2021 20:29:11 +0000 (15:29 -0500)]
librbd/api: trash remove/purge should indicate interrupted move

This will help the user self-diagnose that a trash move operation
was interrupted and therefore the state is invalid.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit c808abea64f00e25c6fd3bcaa7ebf9bc763e7ca0)

4 years agolibrbd/api: allow an interrupted trash move to be restarted
Jason Dillaman [Wed, 10 Mar 2021 20:15:26 +0000 (15:15 -0500)]
librbd/api: allow an interrupted trash move to be restarted

Search the trash entries for a matching image name that is
still in the moving state and allow the operation to be
restarted.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit ed2d696e1eafaa59d29ce6fac952e4e5f4f1e920)

4 years agolibrbd/api: helper method for natively listing the trash
Jason Dillaman [Wed, 10 Mar 2021 19:44:36 +0000 (14:44 -0500)]
librbd/api: helper method for natively listing the trash

The existing list method converts the native TrashImageSpec to the
API's rbd_trash_image_info_t which is missing the source field.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 21adc927fe50ae37069d77482edd4c4e098433c9)

4 years agotest/rgw: test_datalog_autotrim filters out new entries 40674/head
Casey Bodley [Mon, 15 Jun 2020 15:45:11 +0000 (11:45 -0400)]
test/rgw: test_datalog_autotrim filters out new entries

if other sync activity is racing with test_datalog_autotrim, it can
create new datalog entries after the 'datalog autotrim' command runs

instead of asserting that the datalog is empty after trim, assert that
any entries have a marker larger than the max-marker reported by
'datalog status' before the trim

Fixes: https://tracker.ceph.com/issues/45626
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit abd08f1843642e318d74dfadb0f9cf1f6b86d827)

4 years agorgw: return error when trying to copy encrypted object without key 40671/head
Ilsoo Byun [Fri, 11 Dec 2020 00:57:49 +0000 (09:57 +0900)]
rgw: return error when trying to copy encrypted object without key

Fixes: https://tracker.ceph.com/issues/48554
Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
(cherry picked from commit dde1303c92b39daa2d760a110f48dc9655e7765f)

4 years agorgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1 40670/head
Rafał Wądołowski [Wed, 17 Feb 2021 11:47:07 +0000 (12:47 +0100)]
rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1

Don't allow GC to process more gc ojects than RGW_SHARDS_PRIME_1

Fixes: https://tracker.ceph.com/issues/49321
Signed-off-by: Rafał Wądołowski <rwadolowski@cloudferro.com>
(cherry picked from commit 7b163048d93a078e2354665488a27225042d3f1a)

4 years agorgw: return ERR_NO_SUCH_BUCKET early while evaluating bucket policy 40668/head
Abhishek Lekshmanan [Thu, 21 Feb 2019 16:06:52 +0000 (17:06 +0100)]
rgw: return ERR_NO_SUCH_BUCKET early while evaluating bucket policy

Right now we create a ERR_NO_SUCH_BUCKET ret code but continue further
processing. Since this ret code isn't returned at any stage we end up creating a
bucket instance anyway which shouldn't happen and then succeeding the client
call in cases like put bucket versioning. Return an error code early in these
cases

Fixes: http://tracker.ceph.com/issues/38420
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit cf66a6d5a7eee294313a1a08d0524daf939747e5)

4 years agoMerge pull request #40590 from rhcs-dashboard/wip-50069-nautilus
Ernesto Puerta [Thu, 8 Apr 2021 10:44:04 +0000 (12:44 +0200)]
Merge pull request #40590 from rhcs-dashboard/wip-50069-nautilus

nautilus: mgr/dashboard: Fix for alert notification message being undefined

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
4 years agoqa/tasks/mgr/test_progress: fix wait_until_equal 39397/head
Kamoltat [Mon, 8 Feb 2021 15:45:06 +0000 (15:45 +0000)]
qa/tasks/mgr/test_progress: fix wait_until_equal

Octopus ceph_test_case doesn't have period arg
so remove that in wait_until_equal. Also increase
time to wait for complete events by using RECOVERY_PERIOD
instead of EVENT_CREATION_PERIOD

Not needed in masters because only octopus and nautilus
doesn't have a period argument in qa/tasks/mgr/test_progress.py
wait_until_equals() function

Fixes: https://tracker.ceph.com/issues/48824
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit df41ea7467db3b40776030865896af0102129283)

 Conflicts:
qa/tasks/mgr/test_progress.py - trivial fix

4 years agoqa/mgr/progress: fix timeout error when waiting for osd in event
Ricardo Dias [Tue, 3 Sep 2019 10:44:05 +0000 (11:44 +0100)]
qa/mgr/progress: fix timeout error when waiting for osd in event

Fixes: https://tracker.ceph.com/issues/40618
Signed-off-by: Ricardo Dias <rdias@suse.com>
(cherry picked from commit b03537949abd8d453aa06c1580a4578868904bd1)

 Conflicts:
qa/tasks/mgr/test_progress.py - trivial fix

4 years agoMerge pull request #40356 from tchaikov/wip-49537-nautilus
Yuri Weinstein [Tue, 6 Apr 2021 17:41:26 +0000 (10:41 -0700)]
Merge pull request #40356 from tchaikov/wip-49537-nautilus

nautilus: rgw : catch non int exception

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
Reviewed-by: Yuri Weinstein <yweinste@redhat.com>
4 years agoMerge pull request #40547 from rhcs-dashboard/nautilus-decouple-tests-from-build
Ernesto Puerta [Tue, 6 Apr 2021 17:19:08 +0000 (19:19 +0200)]
Merge pull request #40547 from rhcs-dashboard/nautilus-decouple-tests-from-build

mgr/dashboard: decouple unit tests from build artifacts

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
4 years agoMerge pull request #40610 from rhcs-dashboard/nautilus-fix-py2-unicode-password
Ernesto Puerta [Tue, 6 Apr 2021 16:24:29 +0000 (18:24 +0200)]
Merge pull request #40610 from rhcs-dashboard/nautilus-fix-py2-unicode-password

nautilus: mgr/dashboard: python 2: fix error when non-ASCII password

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
4 years agoMerge pull request #40621 from tchaikov/nautilus-osd-scrub-dst
Kefu Chai [Tue, 6 Apr 2021 14:19:10 +0000 (22:19 +0800)]
Merge pull request #40621 from tchaikov/nautilus-osd-scrub-dst

nautilus: test/TestOSDScrub: fix mktime() error

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
4 years agotest/TestOSDScrub: fix mktime() error 40621/head
luo rixin [Thu, 20 Feb 2020 12:07:39 +0000 (20:07 +0800)]
test/TestOSDScrub: fix mktime() error

The var tm tm isn't initialized, when the tm.tm_isdst is a
positive value, mktime(&tm) return -1 result in test failed
in ubuntu 19.10 for aarch64 GLIBC2.30.

Signed-off-by: luo rixin <luorixin@huawei.com>
(cherry picked from commit 4806fce7f46899499549d9235ca87625d806f2da)

4 years agobuild/ops: set empty RPATH for some test executables 40619/head
Nathan Cutler [Tue, 27 Aug 2019 08:24:11 +0000 (10:24 +0200)]
build/ops: set empty RPATH for some test executables

Fixes: https://tracker.ceph.com/issues/41524
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 51a1c621718e65a7062af7dcf12949bdd79a26d1)

4 years agocmake: SKIP_RPATH if RPATH is not necessary
Kefu Chai [Fri, 30 Aug 2019 08:21:03 +0000 (16:21 +0800)]
cmake: SKIP_RPATH if RPATH is not necessary

some executables like ceph_test_mon_memory_target do not link against
libraries built from source tree, like librados and libceph-common. so
cmake does not set RPATH for them. hence cmake complains like:

before this change, `CMAKE_INSTALL_RPATH` is set globally. so cmake is
asked to rewrite the RPATH for all installed targets. but this is not
needed. as some executables do not link against libceph-common. hence,
cmake complains when installing them, like:

CMake Error at src/test/mon/cmake_install.cmake:90 (file):
  file RPATH_CHANGE could not write new RPATH:
    /usr/lib64/ceph
   to the file:
    /home/abuild/rpmbuild/BUILDROOT/ceph-15.0.0-4347.g85a07b9.x86_64/usr/bin/ceph_test_log_rss_usage
   No valid ELF RPATH or RUNPATH entry exists in the file;

after this change, `SKIP_RPATH` is set for those executables which do
not link against any libraries created from ceph source tree. so we can
avoid setting the RPATH for these executables when `make install`.

the same applies to libceph-common.

Fixes: https://tracker.ceph.com/issues/41524
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 61708155b4d9d211b7da21aed8ccfe4c8ed3d932)

4 years agocmake: only link against necessary libs
Kefu Chai [Mon, 2 Sep 2019 08:07:49 +0000 (16:07 +0800)]
cmake: only link against necessary libs

some executables like ceph_test_mon_memory_target does not link against
gtest or gmock, so no need to link agains them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 45bab2cb1cf667c2c5c82a78a141fa5883dbd0e3)

4 years agonautilus: mgr/dashboard: decouple unit tests from build artifacts 40547/head
Alfonso Martínez [Tue, 6 Apr 2021 10:34:02 +0000 (12:34 +0200)]
nautilus: mgr/dashboard: decouple unit tests from build artifacts

Signed-off-by: Alfonso Martínez <almartin@redhat.com>
4 years agonautilus: mgr/dashboard: python 2: fix error when setting non-ASCII password 40610/head
Alfonso Martínez [Tue, 6 Apr 2021 07:42:27 +0000 (09:42 +0200)]
nautilus: mgr/dashboard: python 2: fix error when setting non-ASCII password

Fixes: https://tracker.ceph.com/issues/50155
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
4 years agoMerge pull request #40299 from tchaikov/nautilus-48381
Yuri Weinstein [Mon, 5 Apr 2021 15:54:31 +0000 (08:54 -0700)]
Merge pull request #40299 from tchaikov/nautilus-48381

nautilus: mon/ConfigMap: fix stray option leak

Reviewed-by: Sage Weil <sage@redhat.com>
4 years agoMerge pull request #40128 from neha-ojha/wip-49759-nautilus
Yuri Weinstein [Mon, 5 Apr 2021 15:22:33 +0000 (08:22 -0700)]
Merge pull request #40128 from neha-ojha/wip-49759-nautilus

nautilus: pybind/mgr/balancer/module.py: assign weight-sets to all buckets before balancing

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
4 years agoMerge pull request #40283 from smithfarm/wip-39489-nautilus
Yuri Weinstein [Mon, 5 Apr 2021 15:14:11 +0000 (08:14 -0700)]
Merge pull request #40283 from smithfarm/wip-39489-nautilus

nautilus: ceph.spec.in: Enable tcmalloc on IBM Power and Z

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
4 years agoMerge pull request #40047 from pponnuvel/wip-48713-nautilus
Yuri Weinstein [Mon, 5 Apr 2021 15:13:06 +0000 (08:13 -0700)]
Merge pull request #40047 from pponnuvel/wip-48713-nautilus

nautilus: mgr/ActivePyModules.cc: always release GIL before attempting to acquire a lock

Reviewed-by: Kefu Chai <kchai@redhat.com>