]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
3 years agomgr/dashboard: customizable log-in page text/banner 46343/head
Sarthak0702 [Thu, 14 Apr 2022 10:17:21 +0000 (15:47 +0530)]
mgr/dashboard: customizable log-in page text/banner

Fixes:https://tracker.ceph.com/issues/55231
Signed-off-by: Sarthak0702 <sarthak.dev.0702@gmail.com>
(cherry picked from commit 9f8bcd764e6d488d488e6ba1c05c2972329827b7)

3 years agoMerge pull request #46326 from zdover23/wip-pr-46315-backport-to-pacific upstream/pacific
zdover23 [Wed, 18 May 2022 23:21:07 +0000 (09:21 +1000)]
Merge pull request #46326 from zdover23/wip-pr-46315-backport-to-pacific

pacific: doc/start: s/3/three/ in intro.rst

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
3 years agodoc/start: s/3/three/ in intro.rst 46326/head
Zac Dover [Wed, 18 May 2022 10:36:53 +0000 (20:36 +1000)]
doc/start: s/3/three/ in intro.rst

I'm changing "3" to "three" for two reasons:

1. It's correct.
2. This allows me to test backports into Octopus, Pacific, and Quincy.
   I am particularly interested to see what happens when I attempt
   the backport into Octopus, because backports into Octopus have
   failed. This will provide me with another unit of data.

Signed-off-by: Zac Dover <zac.dover@gmail.com>
(cherry picked from commit 28efcec2d65e85ff2fa54e62b5b134e63ace853b)

3 years agoMerge pull request #46302 from cfsnyder/wip-cfsnyder-gil-deadlock-fix-pacific
David Galloway [Wed, 18 May 2022 19:32:21 +0000 (15:32 -0400)]
Merge pull request #46302 from cfsnyder/wip-cfsnyder-gil-deadlock-fix-pacific

pacific: mgr/ActivePyModules.cc: fix cases where GIL is held while attempting to lock mutex

3 years agoMerge pull request #45878 from dparmar18/backport_mdsdoc_pacific
Anthony D'Atri [Tue, 17 May 2022 19:35:09 +0000 (12:35 -0700)]
Merge pull request #45878 from dparmar18/backport_mdsdoc_pacific

pacific: doc/cephfs/add-remove-mds: added cephadm note, refined "Adding an MDS"

3 years agoMerge pull request #46288 from zdover23/wip-doc-tracker-55676-backport-pacific
zdover23 [Tue, 17 May 2022 15:08:47 +0000 (01:08 +1000)]
Merge pull request #46288 from zdover23/wip-doc-tracker-55676-backport-pacific

pacific: doc/dev: update basic-workflow.rst

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
3 years agodoc/cephfs/add-remove-mds: added cephadm note, refined "Adding an MDS" 45878/head
dparmar18 [Fri, 25 Mar 2022 08:18:54 +0000 (13:48 +0530)]
doc/cephfs/add-remove-mds: added cephadm note, refined "Adding an MDS"

Description: 1) Add a note about using cephadm for setting up the
                cluster and mds(s), also mention the use of ceph
                orchestrator if one needs to setup mds(s) manually.
     2) Changed the term `data point` to `directory` in
                point 1 under "Adding an MDS" section for better
                clarity.

Fixes: https://tracker.ceph.com/issues/54551
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 9e8e1a250e1192cdb1b86650596543d42a2f0401)

3 years agomgr/ActivePyModules.cc: fix cases where GIL is held while attempting to lock mutex 46302/head
Cory Snyder [Tue, 17 May 2022 09:24:53 +0000 (05:24 -0400)]
mgr/ActivePyModules.cc: fix cases where GIL is held while attempting to lock mutex

The mgr process can deadlock if the GIL is held while attempting to lock a mutex.
Relevant regressions were introduced in commit a356bac. This fixes those regressions
and also cleans up some unnecessary yielding of the GIL.

Fixes: https://tracker.ceph.com/issues/55687
Signed-off-by: Cory Snyder <csnyder@iland.com>
3 years agodoc/dev: update basic-workflow.rst 46288/head
Zac Dover [Wed, 13 Apr 2022 14:09:38 +0000 (00:09 +1000)]
doc/dev: update basic-workflow.rst

This PR updates the basic-workflow.rst file
to serve the needs of people in 2022 who were not
present at jump street.

The text has been refined up to the section called
"Integration Tests" (non-inclusive).

Signed-off-by: Zac Dover <zac.dover@gmail.com>
(cherry picked from commit a227e4007a5ce66b63e42facf97f89655edf2169)

3 years agoMerge remote-tracking branch 'gh/pacific' into pacific-release
David Galloway [Mon, 16 May 2022 18:36:37 +0000 (14:36 -0400)]
Merge remote-tracking branch 'gh/pacific' into pacific-release

3 years agoMerge pull request #46117 from zdover23/wip-doc-pr-46109-backport-to-pacific
zdover23 [Sat, 14 May 2022 21:38:31 +0000 (07:38 +1000)]
Merge pull request #46117 from zdover23/wip-doc-pr-46109-backport-to-pacific

Wip doc pr 46109 backport to pacific

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
3 years ago16.2.8 v16.2.8
Jenkins Build Slave User [Thu, 12 May 2022 22:23:14 +0000 (22:23 +0000)]
16.2.8

3 years agoMerge pull request #46096 from aclamk/wip-aclamk-unbounded-wholespace-iterator-pacific
Yuri Weinstein [Wed, 4 May 2022 04:53:27 +0000 (21:53 -0700)]
Merge pull request #46096 from aclamk/wip-aclamk-unbounded-wholespace-iterator-pacific

pacific: revival and backport of fix for RocksDB optimized iterators

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
3 years agodoc/radosgw: fix pgcalc link 46117/head
Ville Ojamo [Mon, 2 May 2022 09:01:51 +0000 (16:01 +0700)]
doc/radosgw: fix pgcalc link

The pgcalc tool has moved to the "old" ceph site so update
the link to avoid a 404.

Signed-off-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
(cherry picked from commit 7e1dc469648028d064a6c0faeabe9ecb3c11f32f)

3 years agodoc/rados/operations: fix pgcalc link
Ville Ojamo [Mon, 2 May 2022 08:59:26 +0000 (15:59 +0700)]
doc/rados/operations: fix pgcalc link

The pgcalc tool has moved to the "old" ceph site so update
the link to avoid a 404.

Signed-off-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
(cherry picked from commit 45f8d746acefe01e2416cedf92aadba1555c22f8)

3 years agokv/RocksDBStore: Remove feature to make WholeSpaceIterator based on bounded iterator 46096/head
Adam Kupczyk [Fri, 29 Apr 2022 21:32:43 +0000 (23:32 +0200)]
kv/RocksDBStore: Remove feature to make WholeSpaceIterator based on bounded iterator

Iterator-bounding feature is introduced to make RocksDB iterators limited, so they
would less likely traverse over tombstones.
This is used when listing keys in fixed range, for example OMAPS for specific object.

It is problematic when extending this logic to WholeSpaceIterator,
since prefix must be taken into account.

Fixes: https://tracker.ceph.com/issues/55444
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
3 years agokv/RocksDBStore: simplify RocksDBStore::get_cf_handle(string, IteratorBounds)
Cory Snyder [Thu, 21 Apr 2022 19:56:06 +0000 (15:56 -0400)]
kv/RocksDBStore: simplify RocksDBStore::get_cf_handle(string, IteratorBounds)

Adds a precondition to RocksDBStore::get_cf_handle(string, IteratorBounds)
to avoid duplicating logic of the only caller (RocksDBStore::get_iterator).
Assertions will fail if preconditions are not met.

Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit 55ef16f6cc1d344b09798e566c2470e81928327a)

3 years agobluestore: add config option to allow rocksdb iterator bounds to be disabled
Cory Snyder [Thu, 21 Apr 2022 17:13:22 +0000 (13:13 -0400)]
bluestore: add config option to allow rocksdb iterator bounds to be disabled

Add osd_rocksdb_iterator_bounds_enabled config option to allow rocksdb iterator bounds to be disabled.
Also includes minor refactoring to shorten code associated with IteratorBounds initialization in bluestore.

Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit ca3ccd9)

Conflicts:
src/common/options/osd.yaml.in

Cherry-pick notes:
- Conflicts due to option definition in common/options.cc in Pacific vs. common/options/osd.yaml.in in later releases

3 years agobluestore: set upper and lower bounds on rocksdb omap iterators
Cory Snyder [Fri, 15 Apr 2022 00:54:15 +0000 (20:54 -0400)]
bluestore: set upper and lower bounds on rocksdb omap iterators

Limits RocksDB omap Seek operations to the relevant key range of the object's omap.
This prevents RocksDB from unnecessarily iterating over delete range tombstones in
irrelevant omap CF shards. Avoids extreme performance degradation commonly caused
by tombstones generated from RGW bucket resharding cleanup. Also prefer CFIteratorImpl
over ShardMergeIteratorImpl when we can determine that all keys within specified
IteratorBounds must be in a single CF.

Fixes: https://tracker.ceph.com/issues/55324
Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit 850c16c2468c3200a340493c12930543f326b0e1)

3 years agoMerge pull request #46085 from adk3798/pacific-revert-network-handling
Yuri Weinstein [Fri, 29 Apr 2022 22:28:11 +0000 (15:28 -0700)]
Merge pull request #46085 from adk3798/pacific-revert-network-handling

pacific: revert bootstrap network handling changes

Reviewed-by: Laura Flores <lflores@redhat.com>
3 years agoMerge pull request #46092 from neha-ojha/wip-55444-pacific
Yuri Weinstein [Fri, 29 Apr 2022 22:27:17 +0000 (15:27 -0700)]
Merge pull request #46092 from neha-ojha/wip-55444-pacific

pacific: [Revert] bluestore: set upper and lower bounds on rocksdb omap iterators

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
3 years agoRevert "bluestore: set upper and lower bounds on rocksdb omap iterators" 46092/head
Neha Ojha [Thu, 28 Apr 2022 21:59:43 +0000 (21:59 +0000)]
Revert "bluestore: set upper and lower bounds on rocksdb omap iterators"

This reverts commit d0b03f227ca7338ec9825b5ce9e549336ef82e9f.

Caused a regression https://tracker.ceph.com/issues/55444

Signed-off-by: Neha Ojha <nojha@redhat.com>
3 years agoRevert "bluestore: add config option to allow rocksdb iterator bounds to be disabled"
Neha Ojha [Thu, 28 Apr 2022 21:59:34 +0000 (21:59 +0000)]
Revert "bluestore: add config option to allow rocksdb iterator bounds to be disabled"

This reverts commit 7d9603058dc9d59c608976d822d59f4738960d16.

Caused a regression https://tracker.ceph.com/issues/55444

Signed-off-by: Neha Ojha <nojha@redhat.com>
3 years agoRevert "kv/RocksDBStore: simplify RocksDBStore::get_cf_handle(string, IteratorBounds)"
Neha Ojha [Thu, 28 Apr 2022 21:59:23 +0000 (21:59 +0000)]
Revert "kv/RocksDBStore: simplify RocksDBStore::get_cf_handle(string, IteratorBounds)"

This reverts commit a1f40617a3d2c83bfd5e1c957d7cff13150d00c7.

Caused a regression https://tracker.ceph.com/issues/55444

Signed-off-by: Neha Ojha <nojha@redhat.com>
3 years agoRevert "mgr/cephadm: fixing public network conf parsing" 46085/head
Adam King [Thu, 28 Apr 2022 21:40:25 +0000 (17:40 -0400)]
Revert "mgr/cephadm: fixing public network conf parsing"

This reverts commit ccc97518b37c885e3144c0a289206a6ccc19551a.

Signed-off-by: Adam King <adking@redhat.com>
3 years agoRevert "mgr/cephadm: Adding cephadm networking configuration checks+refactoring"
Adam King [Thu, 28 Apr 2022 21:39:50 +0000 (17:39 -0400)]
Revert "mgr/cephadm: Adding cephadm networking configuration checks+refactoring"

This reverts commit af4251ee20dbc699449842380d890cf18626be4c.

Signed-off-by: Adam King <adking@redhat.com>
3 years agoMerge pull request #45967 from tchaikov/pacific-pr-45916
Yuri Weinstein [Tue, 26 Apr 2022 18:53:03 +0000 (11:53 -0700)]
Merge pull request #45967 from tchaikov/pacific-pr-45916

pacific: cmake/modules: always use the python3 specified in command line

Reviewed-by: David Galloway <dgallowa@redhat.com>
3 years agoMerge pull request #45868 from votdev/wip-55276-pacific
Ernesto Puerta [Tue, 26 Apr 2022 17:33:35 +0000 (19:33 +0200)]
Merge pull request #45868 from votdev/wip-55276-pacific

pacific: mgr/dashboard: RGW users and buckets tables are empty if the selected gateway is down

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
3 years agoMerge pull request #45980 from rhcs-dashboard/backport-monitoring-pacific
Ernesto Puerta [Tue, 26 Apr 2022 17:33:13 +0000 (19:33 +0200)]
Merge pull request #45980 from rhcs-dashboard/backport-monitoring-pacific

pacific: backport of monitoring related PRs

Reviewed-by: MrFreezeex <NOT@FOUND>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
Reviewed-by: Travis Nielsen <tnielsen@redhat.com>
3 years agoMerge pull request #45963 from cfsnyder/wip-55324-pacific-backport
Yuri Weinstein [Tue, 26 Apr 2022 14:47:53 +0000 (07:47 -0700)]
Merge pull request #45963 from cfsnyder/wip-55324-pacific-backport

pacific: bluestore: set upper and lower bounds on rocksdb omap iterators

Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Laura Flores <lflores@redhat.com>
3 years agoMerge pull request #45861 from rhcs-dashboard/wip-55273-pacific
Ernesto Puerta [Tue, 26 Apr 2022 10:20:16 +0000 (12:20 +0200)]
Merge pull request #45861 from rhcs-dashboard/wip-55273-pacific

pacific: mgr/dashboard: datatable in Cluster Host page hides wrong column on selection

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agoMerge pull request #45418 from votdev/sync_locales
Ernesto Puerta [Tue, 26 Apr 2022 10:19:27 +0000 (12:19 +0200)]
Merge pull request #45418 from votdev/sync_locales

pacific: mgr/dashboard: Pull latest translations from Transifex

Reviewed-by: Nizamudeen A <nia@redhat.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
3 years agoMerge pull request #45956 from votdev/wip-55378-pacific
Ernesto Puerta [Tue, 26 Apr 2022 10:18:59 +0000 (12:18 +0200)]
Merge pull request #45956 from votdev/wip-55378-pacific

pacific: mgr/dashboard: Imrove error message of '/api/grafana/validation' API endpoint

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agomonitoring/grafana: tox doctests tests_dashboards/util.py 45980/head
Pere Diaz Bou [Tue, 26 Apr 2022 07:39:11 +0000 (09:39 +0200)]
monitoring/grafana: tox doctests tests_dashboards/util.py

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agomonitoring/grafana: use Path class instead of split
Pere Diaz Bou [Mon, 3 Jan 2022 11:52:09 +0000 (12:52 +0100)]
monitoring/grafana: use Path class instead of split

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agomonitoring/grafana: remove explicit str casting
Pere Diaz Bou [Mon, 3 Jan 2022 08:32:51 +0000 (09:32 +0100)]
monitoring/grafana: remove explicit str casting

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agomonitoring/grafana: ValueError instead of RuntimeError
Pere Diaz Bou [Thu, 16 Dec 2021 14:31:28 +0000 (15:31 +0100)]
monitoring/grafana: ValueError instead of RuntimeError

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agomonitoring/grafana: Replace missing legendFormat warning with error
Pere Diaz Bou [Thu, 16 Dec 2021 12:34:35 +0000 (13:34 +0100)]
monitoring/grafana: Replace missing legendFormat warning with error

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agomonitoring/grafana: doctest util regex
Pere Diaz Bou [Tue, 14 Dec 2021 08:25:49 +0000 (09:25 +0100)]
monitoring/grafana: doctest util regex

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
3 years agoprometheus: spell check the alert descriptions
Travis Nielsen [Fri, 4 Mar 2022 17:42:02 +0000 (10:42 -0700)]
prometheus: spell check the alert descriptions

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 9cca95b16abd4af3eb3a5630acb3fb7e0cc73a4e)

3 years agomgr/dashboard: Pool overall performance shows multiple entries of same pool in pool...
Aashish Sharma [Thu, 10 Mar 2022 12:20:43 +0000 (17:50 +0530)]
mgr/dashboard: Pool overall performance shows multiple entries of same pool in pool overview

This PR intends to fix this issue

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

3 years agocephadm: change shared_folder directory for prometheus and grafana
Nizamudeen A [Mon, 7 Feb 2022 10:53:29 +0000 (16:23 +0530)]
cephadm: change shared_folder directory for prometheus and grafana

After https://github.com/ceph/ceph/pull/44059 the monitoring/prometheus
and monitoring/grafana/dashboards directories are changed to
monitoring/ceph-mixins. That broke the shared_folders in the cephadm
bootstrap script.

Changed all the instances of monitoring/prometheus and
monitoring/grafana/dashboards to monitoring/ceph-mixins

Also, renaming all the instances of prometheus_alerts.yaml to
prometheus_alerts.yml.

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

3 years agomonitoring: build jsonnet/jb only for testing
Arthur Outhenin-Chalandre [Mon, 24 Jan 2022 09:01:04 +0000 (10:01 +0100)]
monitoring: build jsonnet/jb only for testing

Build jsonnet and jb in the testso that we can build ceph without
internet access and still be able to run the test needed for monitoring
using jsonnet tools.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit 8ff1e6b39976ea5e857b6575934d1a42302c6a0f)

3 years agospec: debian: monitoring: build jsonnet from source to use 0.18.0
Arthur Outhenin-Chalandre [Wed, 5 Jan 2022 11:06:14 +0000 (12:06 +0100)]
spec: debian: monitoring: build jsonnet from source to use 0.18.0

As this new version is recently released it's still not in every distro
we use. We now build jsonnet from source so that we can use this new
version of jsonnet. This commit could be reverted later on when the new
version would be available everywhere.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit ecaf9070aed955c5a7ec7818cd9e2c45ddacc545)

3 years agomgr/dashboard: monitoring: refactor into ceph-mixin
Arthur Outhenin-Chalandre [Tue, 23 Nov 2021 08:30:38 +0000 (09:30 +0100)]
mgr/dashboard: monitoring: refactor into ceph-mixin

Mixin is a way to bundle dashboards, prometheus rules and alerts into
jsonnet package. Shifting to mixin will allow easier integration with
monitoring automation that some users may use.

This commit moves `/monitoring/grafana/dashboards` and
`/monitoring/prometheus` to `/monitoring/ceph-mixin`. Prometheus alerts
was also converted to Jsonnet using an automated way (from yaml to json
to jsonnet). This commit minimises any change made to the generated files
and should not change neithers the dashboards nor the Prometheus alerts.

In the future some configuration will also be added to jsonnet to add
more functionalities to the dashboards or alerts (i.e.: multi cluster).

Fixes: https://tracker.ceph.com/issues/53374
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit 98236e3a1d2855c95d86640645c2984efa83791f)

Conflicts:
      monitoring/grafana/dashboards/CMakeLists.txt
      monitoring/grafana/dashboards/jsonnet/grafana_dashboards.jsonnet
      monitoring/grafana/dashboards/tox.ini
      monitoring/prometheus/README.md
      src/test/CMakeLists.txt

Trivial fixes

      monitoring/ceph-mixin/dashboards_out/osds-overview.json
      monitoring/ceph-mixin/dashboards_out/pool-overview.json
      monitoring/ceph-mixin/dashboards_out/rbd-details.json

Include small fixes not brought in pacific yet

3 years agospec: debian: add golang as build dependency
Arthur Outhenin-Chalandre [Mon, 29 Nov 2021 08:38:57 +0000 (09:38 +0100)]
spec: debian: add golang as build dependency

Add golang as a build dependency to build golang project in the test
for monitoring/ceph-mixin.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit e102620394a5d889e42616278de73dfb3b01f625)

3 years agoMerge pull request #45940 from aaSharma14/wip-55366-pacific
Ernesto Puerta [Mon, 25 Apr 2022 19:24:03 +0000 (21:24 +0200)]
Merge pull request #45940 from aaSharma14/wip-55366-pacific

pacific: mgr/cephadm: update monitoring stack versions

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
3 years agoMerge pull request #45813 from p-se/wip-55221-pacific
Ernesto Puerta [Mon, 25 Apr 2022 17:59:38 +0000 (19:59 +0200)]
Merge pull request #45813 from p-se/wip-55221-pacific

pacific: mgr/dashboard: Compare values of MTU alert by device

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
3 years agoMerge pull request #45723 from rhcs-dashboard/wip-53884-pacific
Ernesto Puerta [Mon, 25 Apr 2022 17:58:07 +0000 (19:58 +0200)]
Merge pull request #45723 from rhcs-dashboard/wip-53884-pacific

pacific: mgr/dashboard: NFS pages shows 'Page not found'

Reviewed-by: Sarthak0702 <NOT@FOUND>
Reviewed-by: Aashish Sharma <aasharma@redhat.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
3 years agoMerge pull request #45721 from rhcs-dashboard/wip-55103-pacific
Ernesto Puerta [Mon, 25 Apr 2022 17:56:18 +0000 (19:56 +0200)]
Merge pull request #45721 from rhcs-dashboard/wip-55103-pacific

pacific: mgr/dashboard: extend daemon actions to host details

Reviewed-by: Sarthak0702 <NOT@FOUND>
Reviewed-by: Aashish Sharma <aasharma@redhat.com>
3 years agoMerge pull request #45725 from rhcs-dashboard/wip-54998-pacific
Ernesto Puerta [Mon, 25 Apr 2022 17:55:14 +0000 (19:55 +0200)]
Merge pull request #45725 from rhcs-dashboard/wip-54998-pacific

pacific: mgr/dashboard: Table columns hiding fix

Reviewed-by: Sarthak0702 <NOT@FOUND>
Reviewed-by: Aashish Sharma <aasharma@redhat.com>
Reviewed-by: kalaspuffar <NOT@FOUND>
3 years agoMerge pull request #45618 from votdev/wip-55006-pacific
Ernesto Puerta [Mon, 25 Apr 2022 17:53:59 +0000 (19:53 +0200)]
Merge pull request #45618 from votdev/wip-55006-pacific

pacific: mgr/dashboard: Language dropdown box is partly hidden on login page

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
3 years agokv/RocksDBStore: simplify RocksDBStore::get_cf_handle(string, IteratorBounds) 45963/head
Cory Snyder [Thu, 21 Apr 2022 19:56:06 +0000 (15:56 -0400)]
kv/RocksDBStore: simplify RocksDBStore::get_cf_handle(string, IteratorBounds)

Adds a precondition to RocksDBStore::get_cf_handle(string, IteratorBounds)
to avoid duplicating logic of the only caller (RocksDBStore::get_iterator).
Assertions will fail if preconditions are not met.

Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit 55ef16f6cc1d344b09798e566c2470e81928327a)

3 years agocmake/modules: use exact version of python3 when finding cython 45967/head
Kefu Chai [Wed, 20 Apr 2022 22:31:21 +0000 (06:31 +0800)]
cmake/modules: use exact version of python3 when finding cython

* CMakeLists.txt:
    always pass "EXACT" to find_package(Python3).
    because per cmake document, "EXACT" only takes effect when
    <Package>_FIND_VERSION_COUNT is greater than 1, where <Package>
    is "Python3". see also cmake/modules/FindPython/Support.cmake
* cmake/modules/AddCephTest.cmake:
    drop redundant find_package(Python3) calls. since Python3 is
    a mandatory requirement for building Ceph, we only need a
    single call of find_package(Python3..) in the top of the source
    tree. the only possible case to repeat it is to ensure that we
    have the correct version of Python3 used in following CMake
    script. but there is no need to repeat it if we just want to
    ensure that we have a python3 interpretor in place.
* cmake/modules/Distutils.cmake:
    always pass "EXACT" to find_package(Python3).
    we should always pass EXACT to find_package() when finding python3,
    this is a follow-up of e2babdfae8c99f39f99a7c8a8f966299b2e62b19

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit ea4ae6d2f17ae8dcfb3d6f215d53b3f82a99270d)

Conflicts:
cmake/modules/AddCephTest.cmake: trivial resolutions

3 years agoMerge pull request #45989 from zdover23/wip-doc-os-recommendations-backport-pacific...
zdover23 [Thu, 21 Apr 2022 23:04:27 +0000 (09:04 +1000)]
Merge pull request #45989 from zdover23/wip-doc-os-recommendations-backport-pacific-2022-04-21

pacific: doc/start: add testing support information

Reviewed-by: Neha Ojha <nojha@redhat.com>
3 years agodoc/start: add testing support information 45989/head
Zac Dover [Tue, 5 Apr 2022 15:48:24 +0000 (01:48 +1000)]
doc/start: add testing support information

This PR adds information about support for testing,
and information about which distros the Ceph project
builds packages for.

This is one in a series of PRs including the following:

https://github.com/ceph/ceph/pull/45385
https://github.com/ceph/ceph/pull/45764

This PR specifically includes the information that Ernesto
Puerta collected here:
https://github.com/ceph/ceph/pull/45385#pullrequestreview-911766656

Signed-off-by: Zac Dover <zac.dover@gmail.com>
(cherry picked from commit 0364f3afcccc85d190237b0a74b4deeefa4738f3)

3 years agobluestore: add config option to allow rocksdb iterator bounds to be disabled
Cory Snyder [Thu, 21 Apr 2022 17:13:22 +0000 (13:13 -0400)]
bluestore: add config option to allow rocksdb iterator bounds to be disabled

Add osd_rocksdb_iterator_bounds_enabled config option to allow rocksdb iterator bounds to be disabled.
Also includes minor refactoring to shorten code associated with IteratorBounds initialization in bluestore.

Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit ca3ccd9)

Conflicts:
src/common/options/osd.yaml.in

Cherry-pick notes:
- Conflicts due to option definition in common/options.cc in Pacific vs. common/options/osd.yaml.in in later releases

3 years agocmake/modules: always use the python3 specified in command line
Kefu Chai [Sat, 16 Apr 2022 01:10:20 +0000 (09:10 +0800)]
cmake/modules: always use the python3 specified in command line

if another python3 with higher version is found by
find_package(Python3), the cmake's install script would just
install the python modules/extensions into that python3's
dist-package directory, and the packaging script would fail
to find these artifacts when trying to package them.

so we need to ensure that the install directories for python
modeules/extensions are always "versioned" with WITH_PYTHON3
cmake option.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit e2babdfae8c99f39f99a7c8a8f966299b2e62b19)

3 years agobluestore: set upper and lower bounds on rocksdb omap iterators
Cory Snyder [Fri, 15 Apr 2022 00:54:15 +0000 (20:54 -0400)]
bluestore: set upper and lower bounds on rocksdb omap iterators

Limits RocksDB omap Seek operations to the relevant key range of the object's omap.
This prevents RocksDB from unnecessarily iterating over delete range tombstones in
irrelevant omap CF shards. Avoids extreme performance degradation commonly caused
by tombstones generated from RGW bucket resharding cleanup. Also prefer CFIteratorImpl
over ShardMergeIteratorImpl when we can determine that all keys within specified
IteratorBounds must be in a single CF.

Fixes: https://tracker.ceph.com/issues/55324
Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit 850c16c2468c3200a340493c12930543f326b0e1)

3 years agoMerge pull request #45936 from adk3798/pacific-rerevert-pids-limit
Yuri Weinstein [Tue, 19 Apr 2022 17:53:16 +0000 (10:53 -0700)]
Merge pull request #45936 from adk3798/pacific-rerevert-pids-limit

pacific: cephadm: revert pids limit

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
3 years agoMerge pull request #45895 from idryomov/wip-persistent-cache-status-pacific
Yuri Weinstein [Tue, 19 Apr 2022 17:52:29 +0000 (10:52 -0700)]
Merge pull request #45895 from idryomov/wip-persistent-cache-status-pacific

pacific: rbd persistent cache UX improvements (status report, metrics, flush command)

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
3 years agomgr/dashboard: Imrove error message of '/api/grafana/validation' API endpoint 45956/head
Volker Theile [Wed, 30 Mar 2022 11:38:33 +0000 (13:38 +0200)]
mgr/dashboard: Imrove error message of '/api/grafana/validation' API endpoint

In case the validation of the Grafana URL fails, e.g. because of an invalid SSL certificate, a useless and not helping default error message is displayed in the UI.
This PR will re-raise the exception as a DashboardException which includes the detailed description of what happened. This will help to identify SSL cert issues much easier for example.

Fixes: https://tracker.ceph.com/issues/55133
Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 83524ed1bfb7c8cef307d7c21c3452cbe7a16c4b)

Conflicts:
src/pybind/mgr/dashboard/services/exception.py

3 years agomgr/dashboard: upgrade grafana pie-chart and vonage-status-panel versions 45940/head
Aashish Sharma [Wed, 6 Apr 2022 09:54:41 +0000 (15:24 +0530)]
mgr/dashboard: upgrade grafana pie-chart and vonage-status-panel versions

Fixes:https://tracker.ceph.com/issues/55195
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 2877920f58728eab20abe32fed24618449d76c09)
(cherry picked from commit 429f242148e493ee4819fe16c844a8d9b980b9a3)

3 years agografana/Makefile: don't push to docker
Ernesto Puerta [Thu, 31 Mar 2022 18:29:17 +0000 (20:29 +0200)]
grafana/Makefile: don't push to docker

Fixes: https://tracker.ceph.com/issues/55155
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
(cherry picked from commit 7e6309fac3c4728b3527ab6c709becfb4dcdb126)
(cherry picked from commit cd16e0d070d7b7ed3f2ac7205bb49e3d246de63a)

3 years agomgr/cephadm: update monitoring stack versions
Aashish Sharma [Mon, 28 Feb 2022 06:16:14 +0000 (11:46 +0530)]
mgr/cephadm: update monitoring stack versions

Fixes: https://tracker.ceph.com/issues/54311
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
(cherry picked from commit 6a328ec30cd2c652c27e3bf070d5de7c2d4367b3)

3 years agoRevert "cephadm: remove containers pids-limit" 45936/head
Adam King [Mon, 18 Apr 2022 19:27:45 +0000 (15:27 -0400)]
Revert "cephadm: remove containers pids-limit"

This reverts commit db74cd951b14213c71b5715d8b123c2d9b27022e.

Signed-off-by: Adam King <adking@redhat.com>
3 years agoRevert "qa/suites/orch/cephadm: restrict test_iscsi_pids_limit to CentOS"
Adam King [Mon, 18 Apr 2022 19:27:31 +0000 (15:27 -0400)]
Revert "qa/suites/orch/cephadm: restrict test_iscsi_pids_limit to CentOS"

This reverts commit 8b780ebf629082aadc68a86bc2ce72adffc8181a.

Signed-off-by: Adam King <adking@redhat.com>
3 years agoMerge pull request #45919 from adk3798/pacific-april-batch1
Adam King [Mon, 18 Apr 2022 16:09:59 +0000 (12:09 -0400)]
Merge pull request #45919 from adk3798/pacific-april-batch1

Cephadm Pacific Batch Backport April

Reviewed-by: Redouane Kachach <rkachach@redhat.com>
3 years agoMerge pull request #45906 from vshankar/wip-snap-sched-backports-1
Yuri Weinstein [Mon, 18 Apr 2022 15:58:34 +0000 (08:58 -0700)]
Merge pull request #45906 from vshankar/wip-snap-sched-backports-1

pacific: mgr/snap_schedule: backports

Reviewed-by: Venky Shankar <vshankar@redhat.com>
3 years agoMerge pull request #45184 from ideepika/wip-54378-pacific
Ilya Dryomov [Mon, 18 Apr 2022 10:23:55 +0000 (12:23 +0200)]
Merge pull request #45184 from ideepika/wip-54378-pacific

pacific: rbd-mirror: synchronize with in-flight stop in ImageReplayer::stop()

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
3 years agoqa: adjust for old snapshot counts during comparison 45906/head
Venky Shankar [Sat, 16 Apr 2022 15:24:44 +0000 (20:54 +0530)]
qa: adjust for old snapshot counts during comparison

This is pacific only commit since in master, the snap-schedule module
uses vfs-ceph backed libcephsqlite which seems to preserve the
snapshots stats (created_count, etc..) on ceph-mgr restarts. Pacific
uses in-memory db (serialized to a RADOS object) which seems to
reset these stats when ceph-mgr is restarted.

Also, remove `db_count' assert check as it doesn't make sense.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
3 years agoqa/suites/orch/cephadm: stop upgrade tests if failures are seen 45919/head
Adam King [Sun, 17 Apr 2022 16:21:44 +0000 (12:21 -0400)]
qa/suites/orch/cephadm: stop upgrade tests if failures are seen

Otherwise the tests may run forever. This was already done for
mds upgrade sequence, justadding it in the other two places here

Related to: https://tracker.ceph.com/issues/53939

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 017aa9cfe8362e8512a581e39850ce70bd1ce82f)

3 years agomgr/cephadm: allow setting insecure_skip_verify for alertmanager
Adam King [Wed, 6 Apr 2022 14:32:22 +0000 (10:32 -0400)]
mgr/cephadm: allow setting insecure_skip_verify for alertmanager

Add a "secure" parameter to alertmanager spec that will cause it
to deploy alertmanagers with insecure_skip_verify as true or false
depending on the value given for "secure".

NOTE: alertmanager must still be reconfigured after applying a yaml
with this option changed.

Fixes: https://tracker.ceph.com/issues/55272
Fixes: https://tracker.ceph.com/issues/55333
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit e583d4ef1ac23a7473d50d253e0edf70580542ae)

3 years agomgr/cephadm: retry mgr fail over in case of transient failure
Adam King [Mon, 11 Apr 2022 20:57:51 +0000 (16:57 -0400)]
mgr/cephadm: retry mgr fail over in case of transient failure

Fixes: https://tracker.ceph.com/issues/55279
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 3fe2d7d553d475f1fe3840c98ee31d71f6188a1a)

3 years agoceph cephadm set-user does not reflect the user change in ssh-config
Teoman ONAY [Wed, 6 Apr 2022 09:32:17 +0000 (11:32 +0200)]
ceph cephadm set-user does not reflect the user change in ssh-config

Fixes: https://tracker.ceph.com/issues/54618
Signed-off-by: Teoman ONAY <tonay@redhat.com>
(cherry picked from commit 071f72a734ce207e5cb2ff6d3d996e45396f5c7a)

3 years agomgr/cephadm: Adding cephadm networking configuration checks+refactoring
Redouane Kachach [Fri, 1 Apr 2022 16:03:42 +0000 (18:03 +0200)]
mgr/cephadm: Adding cephadm networking configuration checks+refactoring
Fixes: https://tracker.ceph.com/issues/55174
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit e0bafe6b1da104782b29edf7035d7bc93f89e12f)

Conflicts:
src/cephadm/cephadm
src/cephadm/tests/test_cephadm.py

3 years agoApply sysctl.d migration from /usr/lib to /etc
windgmbh [Fri, 12 Nov 2021 15:51:03 +0000 (16:51 +0100)]
Apply sysctl.d migration from /usr/lib to /etc
A fix regarding the SYSCTL_DIR location (#53130) requires to migrate
sysctl.d/*.conf files from /usr/lib to /etc.
Signed-off-by: Lukas Mayer <lmayer@wind.gmbh>
(cherry picked from commit a167a27f30536958e0f2c513d351642e81ba06d5)

3 years agoFix sysctl.d location FHS compliance
windgmbh [Wed, 3 Nov 2021 17:16:53 +0000 (18:16 +0100)]
Fix sysctl.d location FHS compliance
This fixes #53130
Containers should not write to '/usr/lib'.
That location could be read-only or overwritten.
Signed-off-by: Lukas Mayer <lmayer@wind.gmbh>
(cherry picked from commit 77afa812ea8b7e1e802246e4aa3a31e7b644a502)

3 years agomgr/cephadm: Making default cephadm shell cmd easier
Redouane Kachach [Thu, 17 Feb 2022 12:48:08 +0000 (13:48 +0100)]
mgr/cephadm: Making default cephadm shell cmd easier
Fixes: https://tracker.ceph.com/issues/52042
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit dc201197639dcab471611ac3c4fefda74a74a94f)

3 years agocephadm: show error message if private registry credentials not provided
Melissa Li [Wed, 23 Mar 2022 15:38:37 +0000 (11:38 -0400)]
cephadm: show error message if private registry credentials not provided

Raise UnauthorizedRegistryError in `_pull_image` if user tries to pull from a private registry without authentication, handle error in `command_bootstrap`, `commond_adopt`, `command_pull`

Fixes: https://tracker.ceph.com/issues/55015
Signed-off-by: Melissa Li <melissali@redhat.com>
(cherry picked from commit 4de0803ba893abf341ab634d1382208370de7c98)

3 years agocephadm: pass "--security-opt label=disable" to node-exporter container
Adam King [Thu, 24 Mar 2022 13:59:10 +0000 (09:59 -0400)]
cephadm: pass "--security-opt label=disable" to node-exporter container

in order to support setting '--path.procfs=/host/proc','--path.sysfs=/host/sys',
'--path.rootfs=/rootfs' for node-exporter we need to disable selinux separation
between the node-exporter container and the host to avoid selinux denials

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 6d4591723ba89dada9814118e2c14e08d4e4179a)

3 years agocephadm: Specify proc/sys path for node-exporter to use
Adam King [Wed, 23 Mar 2022 17:22:51 +0000 (13:22 -0400)]
cephadm: Specify proc/sys path for node-exporter to use

Fixes: https://tracker.ceph.com/issues/55023
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 97373de71e080423a2321e2c889e6681b47bfc74)

Conflicts:
src/cephadm/cephadm

3 years agomgr/cephadm: fixing public network conf parsing
Redouane Kachach [Wed, 30 Mar 2022 13:48:40 +0000 (15:48 +0200)]
mgr/cephadm: fixing public network conf parsing
Fixes: https://tracker.ceph.com/issues/55132
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 3ef6341e8ef5fe6a01f15c847f6bc9e2205d4d97)

3 years agomgr/cephadm: Adding AGE field to device ls cmd
Redouane Kachach [Fri, 4 Feb 2022 12:28:51 +0000 (13:28 +0100)]
mgr/cephadm: Adding AGE field to device ls cmd
Fixes: https://tracker.ceph.com/issues/53540
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 1c5b3e86f9b8ae0ca3ae41798dfa18e9ffe9fcb7)

3 years agoqa: test snap_schedule with mgr restart
Milind Changire [Thu, 24 Feb 2022 06:20:18 +0000 (11:50 +0530)]
qa: test snap_schedule with mgr restart

Scheduled snaps should follow the created schedule even across mgr
restart.

Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit ac6c7240d3b69de128ae2c5f4c172f12e313fd27)

3 years agomgr/snap_schedule: restart old schedules
Milind Changire [Mon, 28 Feb 2022 06:26:09 +0000 (11:56 +0530)]
mgr/snap_schedule: restart old schedules

Old schedules were not picked up from database when mgr was restarted.
Restart old schedules on mgr restart.

Fixes: https://tracker.ceph.com/issues/54052
Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit dca7fdb600932d712280dd91a4eb63a17a8800e3)

3 years agomgr/util: add function to list all fs names
Milind Changire [Mon, 28 Feb 2022 06:22:26 +0000 (11:52 +0530)]
mgr/util: add function to list all fs names

Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit 24915c8ee926c27e335f6e94341770ee8088e721)

3 years agoqa: add test for concurrent snap creates
Milind Changire [Wed, 24 Nov 2021 08:06:30 +0000 (13:36 +0530)]
qa: add test for concurrent snap creates

Test if the number of snaps on the file-system and the stats on created
snaps in the DB match.

NOTE:
Since it is difficult to get the snapshot created on the exact second,
the timestamp comparison has been limited up to the last 'minute' as the
comparison granularity.

Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit e2e4635c188f05e37b710b38d4173dbd4ebf0257)

3 years agomgr/snap_schedule: fix db connection concurrent usage
Milind Changire [Wed, 24 Nov 2021 05:13:11 +0000 (10:43 +0530)]
mgr/snap_schedule: fix db connection concurrent usage

Serialize access to DB connection to avoid transaction aborts due to
concurrent use.

Some flake8-3.9 and mypy parsing error cleanups to keep 'make check' happy.

Fixes: https://tracker.ceph.com/issues/52642
Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit 707543779e24c6bc1489c07f5fa1a239d110d9fb)

Conflicts:
src/pybind/mgr/snap_schedule/fs/schedule.py
src/pybind/mgr/snap_schedule/fs/schedule_client.py
        - changes related to DBConnectionManager to serialize
          db interactions

3 years agotest/rbd_mirror: grab timer lock before calling add_event_after() 45184/head
Ilya Dryomov [Wed, 13 Apr 2022 13:24:04 +0000 (15:24 +0200)]
test/rbd_mirror: grab timer lock before calling add_event_after()

add_event_after() expects an externally provided mutex to be held
for the call.  This was missed in commit 8965a0f2a6f7 ("rbd-mirror:
synchronize with in-flight stop in ImageReplayer::stop()").

Fixes: https://tracker.ceph.com/issues/55317
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 60e16106837e0d23366709f70f39c4f1ae7a2a45)

3 years agolibrbd/cache/pwl: remove RBD_FEATURE_DIRTY_CACHE check in DiscardRequest 45895/head
Ilya Dryomov [Sun, 10 Apr 2022 16:13:48 +0000 (18:13 +0200)]
librbd/cache/pwl: remove RBD_FEATURE_DIRTY_CACHE check in DiscardRequest

"m_image_ctx.features &&RBD_FEATURE_DIRTY_CACHE" is obviously wrong
because it would pretty much always be true.  However, even if bitwise
AND was used, this check would still be dead because DiscardRequest is
only invoked if RBD_FEATURE_DIRTY_CACHE is enabled:

  int invalidate_cache(ImageCtx *ictx) {
  {
    ...
    // Delete writeback cache if it is not initialized
    if ((!ictx->exclusive_lock ||
         !ictx->exclusive_lock->is_lock_owner()) &&
ictx->test_features(RBD_FEATURE_DIRTY_CACHE)) {
      C_SaferCond ctx3;
      ictx->plugin_registry->discard(&ctx3);
      r = ctx3.wait();
    }

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

3 years agolibrbd/cache/pwl: don't crash if cache file removal fails
Ilya Dryomov [Sun, 10 Apr 2022 14:57:24 +0000 (16:57 +0200)]
librbd/cache/pwl: don't crash if cache file removal fails

The non-ec overload will throw fs::filesystem_error on any error
(e.g. EPERM due to unprivileged "rbd persistent-cache invalidate"
being brought up against a privileged workload).

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

3 years agorbd: add persistent-cache flush command
Yin Congmin [Mon, 27 Dec 2021 07:06:49 +0000 (15:06 +0800)]
rbd: add persistent-cache flush command

Add a flush command so that users can manually flush cache.

[ idryomov: error messages, incorporate doc and help.t hunks, drop
  do_persistent_cache_flush() ]

Signed-off-by: Yin Congmin <congmin.yin@intel.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 644fbc9fcc8f12eb93d5cc20054cd8598ab001b7)

3 years agorbd: rename image-cache invalidate command
Yin Congmin [Mon, 27 Dec 2021 03:50:18 +0000 (11:50 +0800)]
rbd: rename image-cache invalidate command

Rename command image-cache to persistent-cache. Refactoring the code
of invalidate command.

[ idryomov: error message, incorporate doc and help.t hunks, drop
  do_persistent_cache_invalidate() ]

Signed-off-by: Yin Congmin <congmin.yin@intel.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 05bfe10ad9fde533aa728f9aa0cc8a8f155c03c5)

3 years agolibrbd/cache/pwl: rename persistent cache key
Yin Congmin [Wed, 22 Dec 2021 07:07:11 +0000 (15:07 +0800)]
librbd/cache/pwl: rename persistent cache key

librbd "internal" metadata keys was change to ".rbd" prefix. Change
peristent cache to ".rbd" too.
And the name of  persistent cache key is IMAGE_CACHE_STATE. Since
this key is planned to be used outside the pwl directory, it seems
more appropriate to change it to a clear name as PERSISTENT_CACHE_STATE.

Signed-off-by: Yin Congmin <congmin.yin@intel.com>
(cherry picked from commit bd66fdda910f02ffe91bb026f82a85f28a6ff225)

3 years agorbd: include persistent cache metrics in "rbd status" report
Ilya Dryomov [Sat, 9 Apr 2022 15:48:17 +0000 (17:48 +0200)]
rbd: include persistent cache metrics in "rbd status" report

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

3 years agorbd: factor out get_percentage() helper
Ilya Dryomov [Sat, 9 Apr 2022 09:06:32 +0000 (11:06 +0200)]
rbd: factor out get_percentage() helper

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

3 years agolibrbd/cache/pwl: no need to set clean and empty in remove_pool_file()
Ilya Dryomov [Fri, 8 Apr 2022 13:53:38 +0000 (15:53 +0200)]
librbd/cache/pwl: no need to set clean and empty in remove_pool_file()

It is redundant -- the only caller sets both since commit 6593e31fff18
("librbd/cache/pwl: correct cache state").

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

3 years agolibrbd/cache/pwl: avoid inconsistencies in ImageCacheState
Ilya Dryomov [Thu, 7 Apr 2022 16:49:46 +0000 (18:49 +0200)]
librbd/cache/pwl: avoid inconsistencies in ImageCacheState

When empty and/or clean bools are updated in I/O handling code paths,
ImageCacheState becomes inconistent for a short while: e.g. with clean
transitioned to true, dirty_bytes counter could still be positive
because the counters are updated only in periodic_stats().  Move to
updating the counters in update_image_cache_state(Context*) to avoid
this.

update_image_cache_state(Context*) now requires m_lock -- most call
sites already hold it anyway.  The only problematic call site was
AbstractWriteLog::shut_down() callback chain: perf_stop() needed to
be moved to the very end since perf counters must be alive now for
update_image_cache_state() to work.

Don't override expect_op_work_queue() in unit tests: completing
context in the same thread now results in a deadlock on m_lock in
all test cases that call AbstractWriteLog::init().

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

3 years agolibrbd/cache/pwl: handle invalid ImageCacheState json
Ilya Dryomov [Thu, 7 Apr 2022 14:02:46 +0000 (16:02 +0200)]
librbd/cache/pwl: handle invalid ImageCacheState json

get_json_format() and create_image_cache_state() attempt to get
particular keys which could result in an unhandled std::runtime_error
exception.  Conversely, ImageCacheState constructor just swallows that
exception which could leave the newly constructed object incorrectly
initialized.  Avoid doing parsing in the constructor and introduce
init_from_config() and init_from_metadata() methods instead.

While at it, move everything out from under "persistent_cache" key.
Also fix init_state_json_write test case which stopped working now
that types are enforced by json_spirit.

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

Conflicts:
src/librbd/cache/pwl/ImageCacheState.cc [ commit
  6eb14774fec0 ("librbd: build without "using namespace std"")
  not in pacific ]