Commit Graph

378 Commits

Author SHA1 Message Date
Ilya Dryomov
b6ea8b3a35
Merge pull request #46454 from idryomov/wip-rbd-unlink-newest-snap-at-capacity
librbd: unlink newest mirror snapshot when at capacity, bump capacity

Reviewed-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Reviewed-by: Mykola Golub <mgolub@suse.com>
2022-06-03 11:51:41 +02:00
Ilya Dryomov
ef83c0f347 librbd: unlink newest mirror snapshot when at capacity, bump capacity
CreatePrimaryRequest::unlink_peer() invoked via "rbd mirror image
snapshot" command or via rbd_support mgr module when creating a new
scheduled mirror snapshot at rbd_mirroring_max_mirroring_snapshots
capacity on the primary cluster can race with Replayer::unlink_peer()
invoked by rbd-mirror when finishing syncing an older snapshot on the
secondary cluster.  Consider the following:

   [ primary: primary-snap1, primary-snap2, primary-snap3
     secondary: non-primary-snap1 (complete), non-primary-snap2 (syncing) ]

0. rbd-mirror is syncing snap1..snap2 delta
1. rbd_support creates primary-snap4
2. due to rbd_mirroring_max_mirroring_snapshots == 3, rbd_support picks
   primary-snap3 for unlinking
3. rbd-mirror finishes syncing snap1..snap2 delta and marks
   non-primary-snap2 complete

   [ snap1 (the old base) is no longer needed on either cluster ]

4. rbd-mirror unlinks and removes primary-snap1
5. rbd-mirror removes non-primary-snap1
6. rbd-mirror picks snap2 as the new base
7. rbd-mirror creates non-primary-snap3 and starts syncing snap2..snap3
   delta

   [ primary: primary-snap2, primary-snap3, primary-snap4
     secondary: non-primary-snap2 (complete), non-primary-snap3 (syncing) ]

8. rbd_support unlinks and removes primary-snap3 which is in-use by
   rbd-mirror

If snap trimming on the primary cluster kicks in soon enough, the
secondary image becomes corrupted: rbd-mirror would eventually finish
"syncing" non-primary-snap3 and mark it complete in spite of bogus data
in the HEAD -- the primary cluster OSDs would start returning ENOENT
for snap trimmed objects.  Luckily, rbd-mirror's attempt to pick snap3
as the new base would wedge the replayer with "split-brain detected:
failed to find matching non-primary snapshot in remote image" error.

Before commit a888bff8d0 ("librbd/mirror: tweak which snapshot is
unlinked when at capacity") this could happen pretty much all the time
as it was the second oldest snapshot that was unlinked.  This commit
changed it to be the third oldest snapshot, turning this into a more
narrow but still very much possible to hit race.

Unfortunately this race condition appears to be inherent to the way
snapshot-based mirroring is currently implemented:

a. when mirror snapshots are created on the producer side of the
   snapshot queue, they are already linked
b. mirror snapshots can be concurrently unlinked/removed on both
   sides of the snapshot queue by non-cooperating clients (local
   rbd_mirror_image_create_snapshot() vs remote rbd-mirror)
c. with mirror peer links off the list due to (a), there is no
   existing way for rbd-mirror to persistently mark a snapshot as
   in-use

As a workaround, bump rbd_mirroring_max_mirroring_snapshots to 5 and
always unlink the newest snapshot (i.e. slot 4) instead of the third
oldest snapshot (i.e. slot 2).  Hopefully this gives enough leeway,
as rbd-mirror would need to sync two snapshots (i.e. transition from
syncing 0-1 to 1-2 and then to 2-3) before potentially colliding with
rbd_mirror_image_create_snapshot() on slot 4.

Fixes: https://tracker.ceph.com/issues/55803
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-05-31 15:14:03 +02:00
Ilya Dryomov
dabcac2060 doc/rbd: add mutual CHAP authentication example
Based on https://github.com/ceph/ceph-iscsi/pull/260.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-05-30 13:51:49 +02:00
Ilya Dryomov
29941e306f
Merge pull request #45887 from bluikko/patch-3
doc: replace spaces with underscores in config option names

Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2022-04-23 10:53:31 +02:00
Ville Ojamo
98ac8e1130 doc: replace spaces with underscores in config option names
Signed-off-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
2022-04-23 09:35:27 +02:00
Yin Congmin
644fbc9fcc 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>
2022-04-12 18:42:05 +02:00
Yin Congmin
05bfe10ad9 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>
2022-04-12 18:42:05 +02:00
Ilya Dryomov
e996fd8060 rbd: include persistent cache metrics in "rbd status" report
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-04-11 11:33:24 +02:00
Yin Congmin
769f3a06ec librbd/cache/pwl: add basic metrics to ImageCacheState
Add basic metrics to ImageCacheState and persist them, including
allocated_bytes, cached_bytes, dirty_bytes, free_bytes and hit/miss
info.

Leverage periodic_stats() timer to call update_image_cache_state.
In order to avoid outputting too much debug information, the original
statistics output log level is changed to 5.

Switch to json_spirit for encoding because encode_json encodes bool as
"true"/"false" string.

Remove rbd_persistent_cache_log_periodic_stats option because we need
to always update cache state.

[ idryomov: add cached_bytes and hits_partial; report misses and
  miss_bytes instead of respective totals; naming ]

Fixes: https://tracker.ceph.com/issues/50614
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-04-11 08:26:47 +02:00
Josh Durgin
e1548ef36a doc/rbd/rbd-config-ref: add more detail on QoS settings
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2022-01-13 11:37:46 -05:00
Josh Durgin
52995842a9 doc/rbd/rbd-config-ref: group QoS options by throttle type
This makes it clearer that there are distinct throttles with the
same groups of settings.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2022-01-11 21:46:37 -05:00
Ilya Dryomov
3b7513e46a
Merge pull request #44157 from CongMinYin/pwl-small-fixes
librbd/cache/pwl: code cleanup and some minor fixes

Reviewed-by: Mykola Golub <mgolub@suse.com>
Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2022-01-06 14:54:31 +01:00
Yin Congmin
1b4f4841bb doc/rbd: change persistent write-back cache to persistent write log cache
The full name of PWL is persistent write log, and the full name of
RWL is replica write log. Change the title to make it consistent
with the name of the feature and better reflect its design.

Signed-off-by: Yin Congmin <congmin.yin@intel.com>
2021-12-31 16:04:19 +08:00
Mara Sophie Grosch
5d872f3a28 doc: add docs for rbd_default_order
Adds documentation how to change default rbd object size. With the
previous option `--order` it was easy to guess the config name for the
default value, with the current option name `--object-size` thats hard
to guess.

Also extends the documentation for rbd_default_order to include
* how object-size is derived from the configured value
* allowed range of the value

In the first version of this commit I also added min and max for this
parameter (12/25, matching the object size range in `man 8
rbd`/Striping/object-size), but this made some tests fail, since some
seem to set values outside this range (and probably are fine since
included for some time already). To have this a doc-change only, I
removed the range.

Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
2021-12-27 19:58:56 +01:00
Dimitri Papadopoulos
7677651618
doc,man: typos found by codespell
Signed-off-by: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com>
2021-12-15 12:04:36 +01:00
Deepika Upadhyay
742e6cbd5f
Merge pull request #43764 from gregsfortytwo/wip-rbd-crash-consistency
doc: fix up rbd snapshot docs around crash consistency

Reviewed-by: Mykola Golub <mykola.golub@clyso.com>
Reviewed-by: Sunny Kumar <sunkumar@redhat.com>
2021-11-20 00:29:16 +05:30
Kefu Chai
3f5ff4ca00
Merge pull request #43765 from inspur-wyq/wip-doc-4
doc/rbd/rbd-mirroring.rst: fix typos

Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2021-11-02 19:32:41 +08:00
Greg Farnum
1903ce28a9 doc: fix up rbd snapshot docs around crash consistency
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
2021-11-01 23:36:47 +00:00
Javier Cacheiro
8d99512e14 doc: data must be a byte string
Data must be a byte string in python 3.

Signed-off-by: Javier Cacheiro <javier.cacheiro.lopez@cesga.es>
2021-10-26 17:14:15 +02:00
Deepika Upadhyay
8a35516294 doc: add iSCSI initiator client configuration section for cephadm
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-10-18 13:21:43 +05:30
Kefu Chai
48c044b618
Merge pull request #43304 from inspur-wyq/wip-doc-3
doc/rbd/rbd-windows.rst: fix typos

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-09-26 21:55:57 +08:00
Madhu Rajanna
4f48612c2c doc/rbd/rbd-kubernetes: add ceph.conf configmap
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-09-24 16:44:46 +02:00
wangyunqing
7d7be31f72 doc/rbd/rbd-mirroring.rst: fix typos
Signed-off-by: wangyunqing <wangyunqing@inspur.com>
2021-09-22 11:20:51 +08:00
wangyunqing
3ab2cddd77 doc/rbd/rbd-windows.rst: fix typos
Signed-off-by: wangyunqing <wangyunqing@inspur.com>
2021-09-22 11:17:48 +08:00
Ilya Dryomov
be23d3cfbf
Merge pull request #43225 from guits/fix-iscsi-doc
doc/iscsi: fix some typos

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-09-21 14:35:59 +02:00
Guillaume Abrioux
a715b3f15c doc/iscsi: fix some typos
This fixes some typos in the iscsi documentation.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2021-09-20 16:02:33 +02:00
Lucian Petrut
0c823a54a6 doc/rbd: describe Hyper-V disk addressing limitations
Hyper-V identifies passthrough VM disks by number instead of SCSI ID, although
the disk number can change across host reboots. This means that the VMs can end
up using incorrect disks after rebooting the host, which is an important
security concern. This issue also affects iSCSI and Fibre Channel disks.

We're going to document this Hyper-V limitation along with possible
workarounds.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2021-09-08 06:27:25 +00:00
Ilya Dryomov
b367672082 doc: adjust client.rbd-mirror-peer mon cap
On top of "profile rbd" permissions, "profile rbd-mirror-peer" also
allows getting rbd/mirror and setting rbd/mirror/peer/* config keys.
This is what "rbd mirror pool peer bootstrap create" does.

Fixes: https://tracker.ceph.com/issues/50970
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-09-03 18:17:47 +02:00
Ilya Dryomov
1fe44830b6 doc: add some details about rbd-mirror site names
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-09-03 18:17:47 +02:00
Ilya Dryomov
7b3fe154e5 doc/rbd/rbd-nomad: fix indentation in config snippets
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-08-27 14:12:35 +02:00
Zac Dover
977e6cffb3 doc: clean rbd-nomad.rst
This PR improves the rbd-nomad.rst file.

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2021-08-27 14:12:35 +02:00
Ilya Dryomov
8a3448f6a9
Merge pull request #42806 from zdover23/wip-doc-2021-08-17-rbd-nomad-3-of-x
doc: rewrite configure ceph-csi to "conf. nomad"

Reviewed-by: Etienne Menguy <etienne.menguy@croit.io>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-08-24 17:41:57 +02:00
Zac Dover
795877cd49 doc: rewrite configure ceph-csi to "conf. nomad"
This PR rewrites the sections
     - Configure Ceph-CSI
     - Configure Nomad

in the rbd-nomad.rst Chapter of the RBD
Guide.

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2021-08-24 16:55:30 +02:00
Ilya Dryomov
b8921a0c9a
Merge pull request #42805 from zdover23/wip-doc-2021-08-17-rbd-nomad-2-of-x
doc: improve "Create a Pool" in rbd-nomad.rst

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-08-24 16:32:42 +02:00
Zac Dover
1715989e06 doc: improve "Create a Pool" in rbd-nomad.rst
This PR improves the English in the "Create
a Pool" section of the "RBD & Nomad Integration"
chapter of the RBD Guide.

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2021-08-24 16:16:24 +02:00
Zac Dover
66ebe00fb3 doc: improve RBD "Block Devices and Nomad"
This PR improves the English syntax and
spelling in the "Block Devices and Nomad"
section of the rbd-nomad.rst page.

This PR rewrites the top-level matter.

Signed-off-by: Zac Dover <zac.dover@gmail.com>
2021-08-17 14:34:49 +10:00
Etienne Menguy
c20a37698d
Improving syntax
Signed-off-by: Etienne Menguy <etienne.menguy@croit.io>
2021-07-07 10:26:21 +02:00
Etienne Menguy
a335ee96ab
Adding missing sudo
Signed-off-by: Etienne Menguy <etienne.menguy@croit.io>
2021-07-07 10:14:12 +02:00
Etienne Menguy
0a2a461a0c
Fixing typo
Signed-off-by: Etienne Menguy <etienne.menguy@croit.io>
2021-07-07 10:13:22 +02:00
Etienne Menguy
4f4110b980 Adding rbd-nomad to the index
Signed-off-by: Etienne Menguy <etienne.menguy@croit.io>
2021-07-03 22:58:39 +02:00
Etienne Menguy
849e2bb782 Initial commit to add rbd and nomad integration documentation
Signed-off-by: Etienne Menguy <etienne.menguy@croit.io>
2021-07-03 22:58:09 +02:00
Sandro Bonazzola
a5c361b648 doc/rbd/iscsi-initiator-linux: set "product" in multipath.conf
Adding missing parameter in multipath configuration.  See
https://bugzilla.redhat.com/show_bug.cgi?id=1769135.

Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
2021-06-30 23:46:11 +02:00
Grzegorz Wieczorek
f5577f1e9a doc/rbd: add missing snapshot in command line examples
Signed-off-by: Grzegorz Wieczorek <grzegorz.wieczorek@onito.pl>
2021-05-23 23:06:48 +02:00
Ilya Dryomov
e78e41c7f4
Merge pull request #41256 from tchaikov/wip-doc-rbd-confval
doc/rbd/rbd-config-ref: use confval directive to define options

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-11 22:28:46 +02:00
Kefu Chai
50c15dd7f0 doc/rbd/rbd-config-ref: use confval directive to define options
less repeating this way.

also fix a typo of "rbd_qos_writ_bps_limit", it should be
"rbd_qos_write_bps_limit".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-11 10:14:46 +08:00
Ilya Dryomov
797709ebb1 doc/rbd/rbd-persistent-write-back-cache: clarify some config settings
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-06 11:20:23 +02:00
Ilya Dryomov
a227abfb36 doc/rbd/rbd-persistent-write-back-cache: update "Cache Status" section
Amend the example output and drop the word "transient" -- currently it
is the exact opposite, as the status is updated only when the cache is
opened and closed.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-06 11:20:23 +02:00
Ilya Dryomov
d12e7f458b rbd: --source-spec-file should be --source-spec-path
It was renamed during development, get rid of the leftovers.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-04-29 18:10:54 +02:00
Ilya Dryomov
6f77102706 doc/rbd/rbd-kubernetes: expose volume expansion functionality
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-04-19 11:52:23 +02:00
Ilya Dryomov
d0d4100040 doc/rbd/rbd-kubernetes: imageFeatures is required
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-04-19 11:52:23 +02:00