]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
17 months agocommon/bit_vector: fix IteratorImpl post-increment operator
Ilya Dryomov [Sat, 6 Jan 2024 11:22:35 +0000 (12:22 +0100)]
common/bit_vector: fix IteratorImpl post-increment operator

It's totally broken: instead of returning the current position and
moving to the next position, it returns the next position and doesn't
move anywhere.  Luckily it hasn't been used until now.

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

17 months agolibrbd: drop DiffIterate::diff_object_map() declaration
Ilya Dryomov [Thu, 28 Dec 2023 09:52:11 +0000 (10:52 +0100)]
librbd: drop DiffIterate::diff_object_map() declaration

This is a leftover from commit 2b3a46801d39 ("librbd: switch
diff-iterate API to use new object-map diff helper").

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

17 months agolibrbd: propagate diff-iterate range to parent in fast-diff mode
Ilya Dryomov [Thu, 28 Dec 2023 09:14:18 +0000 (10:14 +0100)]
librbd: propagate diff-iterate range to parent in fast-diff mode

When getting parent diff, pass the overlap-reduced image extent instead
of the entire 0..overlap range to avoid a similar quadratic slowdown on
cloned images.

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

Conflicts:
src/librbd/api/DiffIterate.cc [ ImageArea support not in
  pacific ]

17 months agolibrbd/object_map: add support for ranged diff-iterate
Ilya Dryomov [Wed, 27 Dec 2023 17:07:05 +0000 (18:07 +0100)]
librbd/object_map: add support for ranged diff-iterate

Currently diff-iterate in fast-diff mode is performed on the entire
image no matter what image extent is passed to the API.  Then, unused
diff just gets discarded as DiffIterate ends up querying only objects
that the passed image extent maps to.  This hasn't been an issue for
internal consumers ("rbd du", "rbd diff", etc) because they work on the
entire image, but turns out to lead to quadratic slowdown in some QEMU
use cases.

0..UINT64_MAX range is carved out for deep-copy which is unranged by
definition.  To get effectively unranged diff-iterate, 0..UINT64_MAX-1
range can be used.

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

Conflicts:
src/librbd/object_map/DiffRequest.cc [ commit ef12761bdb03
  ("librbd: use uint64 for return value of size()") not in
  pacific ]

17 months agoinclude/intarith: introduce round_down_to()
Ilya Dryomov [Wed, 27 Dec 2023 15:18:50 +0000 (16:18 +0100)]
include/intarith: introduce round_down_to()

Same as with round_up_to(), d isn't required to be a power of two.

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

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

17 months agotest/librbd: expand TestMockObjectMapDiffRequest edge case coverage
Ilya Dryomov [Sat, 23 Dec 2023 14:19:09 +0000 (15:19 +0100)]
test/librbd: expand TestMockObjectMapDiffRequest edge case coverage

For each covered edge case or error, run through the following
scenarios:

- where the edge case concerns snap_id_start
- where the edge case concerns snap_id_end
- where the edge case concerns intermediate snapshot and
  snap_id_start == 0 (diff against the beginning of time)
- where the edge case concerns intermediate snapshot and
  snap_id_start != 0 (diff from snapshot)

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

17 months agolibrbd/object_map: allow intermediate snaps to be skipped on diff-iterate
Ilya Dryomov [Sat, 23 Dec 2023 13:47:54 +0000 (14:47 +0100)]
librbd/object_map: allow intermediate snaps to be skipped on diff-iterate

In case of diff-iterate against the beginning of time, the result
depends only on the end version.  Loading and processing object maps
or intermediate snapshots is redundant and can be skipped.

This optimization is made possible by commit be507aaed15f ("librbd:
diff-iterate shouldn't ever report "new hole" against a hole") and, to
a lesser extent, the previous commit.

Getting FastDiffInvalid, LoadObjectMapError and ObjectMapTooSmall to
pass required tweaking not just expectations, but also start/end snap
ids and thus also the meaning of these tests.  This is addressed in the
next commit.

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

17 months agolibrbd/object_map: resurrect diff-iterate behavior when image is shrunk
Ilya Dryomov [Fri, 22 Dec 2023 17:50:20 +0000 (18:50 +0100)]
librbd/object_map: resurrect diff-iterate behavior when image is shrunk

The new "track the largest of all versions in the set, diff state is
only ever grown" semantics introduced in commit 330f2a7bb94f ("librbd:
helper state machine for computing diffs between object-maps") don't
make sense for diff-iterate.  It's a waste because DiffIterate won't
query beyond the end version size -- this is baked into the API.

Limit this behavior to deep-copy and resurrect the original behavior
from 2015 for diff-iterate.

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

Conflicts:
src/librbd/object_map/DiffRequest.cc [ commit ef12761bdb03
  ("librbd: use uint64 for return value of size()") not in
  pacific ]

17 months agolibrbd/object_map: fix diff from snapshot when image is grown
Ilya Dryomov [Fri, 22 Dec 2023 15:10:12 +0000 (16:10 +0100)]
librbd/object_map: fix diff from snapshot when image is grown

Commit 399a45e11332 ("librbd/object_map: rbd diff between two
snapshots lists entire image content") fixed most of the damage caused
by commit b81cd2460de7 ("librbd/object_map: diff state machine should
track object existence"), but the case of a "resize diff" when diffing
from snapshot was missed.  An area that was freshly allocated in image
resize is the same in principle as a freshly created image and objects
marked OBJECT_EXISTS_CLEAN are no exception.  Diff for such objects in
such an area should be set to DIFF_STATE_DATA_UPDATED, however
currently when diffing from snapshot, it's set to DIFF_STATE_DATA.

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

17 months agolibrbd/object_map: drop bogus if in handle_load_object_map()
Ilya Dryomov [Wed, 20 Dec 2023 11:22:17 +0000 (12:22 +0100)]
librbd/object_map: drop bogus if in handle_load_object_map()

It became redundant with commit b81cd2460de7 ("librbd/object_map: diff
state machine should track object existence") -- it != end_it condition
in the loop is sufficient.

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

17 months agotest/librbd: refactor TestMockObjectMapDiffRequest tests
Ilya Dryomov [Thu, 21 Dec 2023 15:50:31 +0000 (16:50 +0100)]
test/librbd: refactor TestMockObjectMapDiffRequest tests

In preparation for multiple similarly configured MockTestImageCtx
objects being used in a single test, centralize their creation and add
a couple of helpers for setting expectations from a callback.

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

17 months agotest/librbd: improve TestMockObjectMapDiffRequest.InvalidStartSnap
Ilya Dryomov [Thu, 21 Dec 2023 17:08:21 +0000 (18:08 +0100)]
test/librbd: improve TestMockObjectMapDiffRequest.InvalidStartSnap

Use a range where only snap_id_start is invalid.

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

18 months agoMerge pull request #55113 from k0ste/wip-63980-pacific
Yuri Weinstein [Thu, 11 Jan 2024 21:17:03 +0000 (13:17 -0800)]
Merge pull request #55113 from k0ste/wip-63980-pacific

pacific: mon/Monitor: during shutdown don't accept new authentication and crea…

Reviewed-by: Laura Flores <lflores@redhat.com>
18 months agoMerge pull request #55111 from k0ste/wip-63975-pacific
Yuri Weinstein [Thu, 11 Jan 2024 21:16:28 +0000 (13:16 -0800)]
Merge pull request #55111 from k0ste/wip-63975-pacific

pacific: Tools/rados: Improve Error Messaging for Object Name Resolution

Reviewed-by: Laura Flores <lflores@redhat.com>
18 months agoMerge pull request #54553 from k0ste/wip-63366-pacific
Yuri Weinstein [Thu, 11 Jan 2024 21:15:56 +0000 (13:15 -0800)]
Merge pull request #54553 from k0ste/wip-63366-pacific

pacific: mgr: remove out&down osd from mgr daemons

Reviewed-by: Laura Flores <lflores@redhat.com>
18 months agoMerge pull request #54013 from k0ste/wip-63035-pacific
Yuri Weinstein [Thu, 11 Jan 2024 21:15:04 +0000 (13:15 -0800)]
Merge pull request #54013 from k0ste/wip-63035-pacific

pacific: mgr: add throttle policy for DaemonServer

Reviewed-by: Laura Flores <lflores@redhat.com>
18 months agoMerge pull request #55118 from pdvian/wip-63987-pacific
Laura Flores [Thu, 11 Jan 2024 19:51:16 +0000 (13:51 -0600)]
Merge pull request #55118 from pdvian/wip-63987-pacific

pacific: mon: add exception handling to ceph health mute

18 months agoMerge pull request #55090 from cbodley/wip-63963-pacific
Laura Flores [Tue, 9 Jan 2024 23:35:10 +0000 (17:35 -0600)]
Merge pull request #55090 from cbodley/wip-63963-pacific

pacific: make-dist: don't use --continue option for wget

18 months agomon: add exception handling to ceph health mute 55118/head
dradjenovic [Tue, 25 Oct 2022 20:47:10 +0000 (20:47 +0000)]
mon: add exception handling to ceph health mute

Signed-off-by: Daniel Radjenovic <dradjenovic@digitalocean.com>
(cherry picked from commit 08abc31359345751432701de36b00d207d3fb6f6)

18 months agomon/Monitor: during shutdown don't accept new authentication and create new sessions 55113/head
Nitzan Mordechai [Thu, 1 Jun 2023 09:30:48 +0000 (09:30 +0000)]
mon/Monitor: during shutdown don't accept new authentication and create new sessions
During shutdown, the monitor is designed not to accept new authentication requests
or create new sessions. However, a problem arises when the monitor marks its status
as "shutdown" but still accepts new authentication requests and creates new sessions.
This issue causes the monitor to fail when checking the session list.

To fix this problem, an update is implemented. With this fix,
a monitor in the "shutdown" state will correctly reject new authentication requests
and prevent the creation of new sessions.
This ensures that the monitor operates as intended during the shutdown process.

Fixes: https://tracker.ceph.com/issues/56192
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
(cherry picked from commit 4a8c21e3763dad41555765143f4b76f3a543b4f4)

18 months agoTools/rados: Improve Error Messaging for Object Name Resolution 55111/head
NitzanMordhai [Thu, 16 Nov 2023 07:09:29 +0000 (07:09 +0000)]
Tools/rados: Improve Error Messaging for Object Name Resolution

The current implementation of 'rados clearomap' exhibits a behavior where
an error message is generated without the associated object name or,
in the case of a non-existent object name, may result in a segmentation fault.

The proposed fix addresses this issue by enhancing the error message.
After applying the fix, error messages will consistently display the correct
object name, providing users with more accurate and actionable information.

Fixes: https://tracker.ceph.com/issues/63541
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
(cherry picked from commit 313bfca056ef7f83c0e8c70a3bc4ff9d070b63d9)

18 months agoMerge pull request #55086 from petrutlucian94/wip-63954-pacific
Casey Bodley [Tue, 9 Jan 2024 14:12:19 +0000 (14:12 +0000)]
Merge pull request #55086 from petrutlucian94/wip-63954-pacific

pacific: win32_deps_build.sh: change Boost URL

Reviewed-by: Guillaume Abrioux <gabrioux@ibm.com>
18 months agoMerge pull request #55013 from Matan-B/wip-63878-pacific
Yuri Weinstein [Mon, 8 Jan 2024 23:00:03 +0000 (15:00 -0800)]
Merge pull request #55013 from Matan-B/wip-63878-pacific

pacific: tools/ceph_objectstore_tool: Support get/set/superblock

Reviewed-by: Laura Flores <lflores@redhat.com>
18 months agoMerge pull request #54707 from k0ste/wip-63311-pacific
Yuri Weinstein [Mon, 8 Jan 2024 20:44:25 +0000 (12:44 -0800)]
Merge pull request #54707 from k0ste/wip-63311-pacific

pacific: ceph-volume: fix a bug in _check_generic_reject_reasons

Reviewed-by: Guillaume Abrioux <gabrioux@redhat.com>
18 months agoMerge pull request #55024 from idryomov/wip-63607-pacific
Radoslaw Zarzynski [Mon, 8 Jan 2024 20:36:33 +0000 (21:36 +0100)]
Merge pull request #55024 from idryomov/wip-63607-pacific

pacific: librados: make querying pools for selfmanaged snaps reliable

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
18 months agomake-dist: don't use --continue option for wget 55090/head
Casey Bodley [Mon, 8 Jan 2024 16:24:18 +0000 (08:24 -0800)]
make-dist: don't use --continue option for wget

the boost jfrog mirror is broken and returns an HTML error page instead
of the archive. the file size of this page is 11534 bytes

when download_from() retries the download from download.ceph.com, the -c
option tells it to resume the download of the existing file. the
resulting boost_1_82_0.tar.bz2 ends up with the correct total file size
of 121325129 bytes, but the first 11534 bytes still correspond to the
HTML from jfrog. that causes the sha256sum mismatch

remove the -c option so that wget fetches the archive in its entirety

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 2ba7d6e59e8750867059c29a33c22bcb3e358b65)

18 months agowin32_deps_build.sh: change Boost URL 55086/head
Lucian Petrut [Mon, 8 Jan 2024 08:44:51 +0000 (08:44 +0000)]
win32_deps_build.sh: change Boost URL

The Boost download URL is broken again [1], we'll switch to a
working mirror.

[1] https://github.com/boostorg/boost/issues/842

Fixes: https://tracker.ceph.com/issues/63952
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 594d1e5e83e3d4c318ab1dd79660670a0852f7e6)

18 months agoMerge pull request #54912 from lxbsz/wip-63833
Yuri Weinstein [Wed, 3 Jan 2024 16:16:35 +0000 (08:16 -0800)]
Merge pull request #54912 from lxbsz/wip-63833

pacific: mds: set the loner to true for LOCK_EXCL_XSYN

Reviewed-by: Kotresh HR khiremat@redhat.com
18 months agoMerge pull request #54696 from k0ste/wip-63660-pacific
Yuri Weinstein [Fri, 29 Dec 2023 15:52:05 +0000 (07:52 -0800)]
Merge pull request #54696 from k0ste/wip-63660-pacific

pacific: doc/rados/configuration/bluestore-config-ref: Fix lowcase typo

Reviewed-by: Nitzan Mordechai <nmordech@redhat.com>
18 months agotools/rados: just return instead of exit(1) in "rados cppool" handler 55024/head
Ilya Dryomov [Fri, 24 Nov 2023 18:53:48 +0000 (19:53 +0100)]
tools/rados: just return instead of exit(1) in "rados cppool" handler

Otherwise an occasional segfault occurs.  This instance was missed in
commit 2c149262888c ("tools/rados: always call rados.shutdown() before
exit()").

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

18 months agoqa: make sure "rados cppool" requires --yes-i-really-mean-it for RBD
Ilya Dryomov [Thu, 23 Nov 2023 19:24:24 +0000 (20:24 +0100)]
qa: make sure "rados cppool" requires --yes-i-really-mean-it for RBD

Safeguards in rados CLI tool isn't really the subject of this test, but
it fits nicely.

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

18 months agolibrados: make querying pools for selfmanaged snaps reliable
Ilya Dryomov [Wed, 22 Nov 2023 13:39:13 +0000 (14:39 +0100)]
librados: make querying pools for selfmanaged snaps reliable

If get_pool_is_selfmanaged_snaps_mode() is invoked on a fresh RADOS
client instance that still lacks an osdmap, it returns false, same as
for "this pool is not in selfmanaged snaps mode".  The same happens if
the pool in question doesn't exist since the signature doesn't allow to
return an error.

The motivation for this API was to prevent users from running "rados
cppool" on a pool with unmanaged snapshots and deleting the original
thinking that they have a full copy.  Unfortunately, it's exactly
"rados cppool" that fell into this trap, so no warning is printed and
--yes-i-really-mean-it flag isn't enforced.

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

Conflicts:
PendingReleaseNotes [ moved to >=16.2.15 section ]

18 months agolibrados: clarify get_pool_is_selfmanaged_snaps_mode() semantics
Ilya Dryomov [Thu, 23 Nov 2023 19:35:41 +0000 (20:35 +0100)]
librados: clarify get_pool_is_selfmanaged_snaps_mode() semantics

Refer to the commit message of 8a9769a1d5fd ("librados: add
get_pool_is_selfmanaged_snaps_mode() function").

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

18 months agoMerge pull request #54949 from idryomov/wip-53897-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:43:24 +0000 (07:43 -0800)]
Merge pull request #54949 from idryomov/wip-53897-pacific

pacific: librbd: don't report HOLE_UPDATED when diffing against a hole

Reviewed-by: Mykola Golub <mgolub@suse.com>
18 months agoMerge pull request #54548 from k0ste/wip-62818-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:41:37 +0000 (07:41 -0800)]
Merge pull request #54548 from k0ste/wip-62818-pacific

pacific: osd: ensure async recovery does not drop a pg below min_size

Reviewed-by: Neha Ojha <nojha@redhat.com>
18 months agoMerge pull request #53470 from k0ste/wip-51195-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:40:53 +0000 (07:40 -0800)]
Merge pull request #53470 from k0ste/wip-51195-pacific

pacific: rados: increase osd_max_write_op_reply_len default to 64 bytes

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
18 months agoMerge pull request #52555 from k0ste/wip-62091-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:40:22 +0000 (07:40 -0800)]
Merge pull request #52555 from k0ste/wip-62091-pacific

pacific:  mon: fix iterator mishandling in PGMap::apply_incremental

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
18 months agoMerge pull request #51692 from k0ste/wip-61340-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:39:38 +0000 (07:39 -0800)]
Merge pull request #51692 from k0ste/wip-61340-pacific

pacific: mgr/prometheus: fix pool_objects_repaired and daemon_health_metrics format

Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
18 months agoMerge pull request #51414 from kamoltat/wip-ksirivad-backport-pacific-47340-and-50857
Yuri Weinstein [Thu, 28 Dec 2023 15:36:58 +0000 (07:36 -0800)]
Merge pull request #51414 from kamoltat/wip-ksirivad-backport-pacific-47340-and-50857

pacific:mon/Monitor.cc: exit function if !osdmon()->is_writeable() && mon/OSDMonitor: Added extra check before mon.go_recovery_stretch_mode()

Reviewed-by: Nitzan Mordechai <nmordech@redhat.com>
18 months agoMerge pull request #50518 from badone/wip-57209-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:35:26 +0000 (07:35 -0800)]
Merge pull request #50518 from badone/wip-57209-pacific

pacific: test/lazy-omap-stats: Various enhancements

Reviewed-by: Laura Flores <lflores@redhat.com>
18 months agoMerge pull request #46696 from NitzanMordhai/wip-54281-pacific
Yuri Weinstein [Thu, 28 Dec 2023 15:34:06 +0000 (07:34 -0800)]
Merge pull request #46696 from NitzanMordhai/wip-54281-pacific

pacific: pybind/mgr: ceph osd status crash with ZeroDivisionError

Reviewed-by: Matan Breizman <Matan.Brz@gmail.com>
18 months agoMerge pull request #54901 from cbodley/wip-pacific-rhel-8.6
Yuri Weinstein [Wed, 27 Dec 2023 18:06:20 +0000 (10:06 -0800)]
Merge pull request #54901 from cbodley/wip-pacific-rhel-8.6

pacific: qa/distros: backport update from rhel 8.4 -> 8.6

Reviewed-by: Venky Shankar <vshankar@redhat.com>
18 months agodoc/man/8/ceph-objectstore-tool.rst: add get/set superblock doc 55013/head
Matan Breizman [Sun, 15 Oct 2023 14:23:36 +0000 (14:23 +0000)]
doc/man/8/ceph-objectstore-tool.rst: add get/set superblock doc

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit fc1049764c0bb2158278b309764c4a298da70d41)

18 months agotools/ceph_objectstore_tool: Support get-/set-/superblock
Matan Breizman [Sun, 15 Oct 2023 10:50:52 +0000 (10:50 +0000)]
tools/ceph_objectstore_tool: Support get-/set-/superblock

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit 1a547ca4640fd9c3f4f25fe1d85fb09043ebd5bc)

18 months agoMerge pull request #54691 from Matan-B/wip-63649-pacific
Laura Flores [Tue, 19 Dec 2023 18:36:26 +0000 (12:36 -0600)]
Merge pull request #54691 from Matan-B/wip-63649-pacific

pacific: tools/ceph_objectstore_tool: action_on_all_objects_in_pg to skip pgmeta

19 months agotest/pybind/rbd: don't ignore from_snapshot in check_diff() 54949/head
Ilya Dryomov [Sun, 10 Dec 2023 16:01:24 +0000 (17:01 +0100)]
test/pybind/rbd: don't ignore from_snapshot in check_diff()

Despite the test in test_diff_iterate() being correct, it started
failing:

    >       check_diff(self.image, 0, IMG_SIZE, 'snap1', [(0, 512, False)])
    ...
    a = [], b = [(0, 512, False)]
    ...
    >       assert a == b
    E       AssertionError

This is because check_diff() drops 'snap1' argument on the floor and
passes None to image.diff_iterate() instead.  This goes back to 2013,
see commit e88fe3cbbc8f ("rbd.py: add some missing functions").

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

19 months agotest/librbd: redo TestMockObjectMapDiffRequest.*Delta tests
Ilya Dryomov [Sun, 3 Dec 2023 15:39:39 +0000 (16:39 +0100)]
test/librbd: redo TestMockObjectMapDiffRequest.*Delta tests

Existing *Delta tests cover:

- beginning of time -> HEAD, through intermediate snap
- snap -> snap, directly
- snap -> HEAD, directly

But coverage is too weak: none of the weird OBJECT_PENDING cases and
only a single diff-iterate vs deep-copy case is tested, for example.

Coverage is missing completely for:

- beginning of time -> HEAD, directly
- beginning of time -> snap, directly
- beginning of time -> snap, through intermediate snap
- snap -> snap, through intermediate snap
- snap -> HEAD, through intermediate snap

This adds the following tests:

- FromBeginningToHead
- FromBeginningToHeadIntermediateSnap (expands FullDelta)
- FromBeginningToSnap
- FromBeginningToSnapIntermediateSnap
- FromSnapToSnap (expands IntermediateDelta)
- FromSnapToSnapIntermediateSnap
- FromSnapToHead (expands EndDelta)
- FromSnapToHeadIntermediateSnap

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

19 months agotest/librbd: parametrize TestMockObjectMapDiffRequest tests
Ilya Dryomov [Sun, 3 Dec 2023 13:49:43 +0000 (14:49 +0100)]
test/librbd: parametrize TestMockObjectMapDiffRequest tests

Exercise both diff-iterate and deep-copy modes of operation.

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

19 months agolibrbd: OBJECT_PENDING should always be treated as dirty
Ilya Dryomov [Fri, 8 Dec 2023 14:19:02 +0000 (15:19 +0100)]
librbd: OBJECT_PENDING should always be treated as dirty

OBJECT_PENDING is a transition state which normally isn't encountered
in (snapshot) object maps.  In case it's encountered, for example when
a snapshot is taken after losing power at the time a discard was being
handled, the object should be treated as dirty and produce a diff as
a result.

Assuming an object is marked OBJECT_PENDING, theoretically there are
four cases with respect to object's state in the next snapshot:

    1. OBJECT_NONEXISTENT
    2. OBJECT_EXISTS
    3. OBJECT_PENDING
    4. OBJECT_EXISTS_CLEAN

Prior to commit b81cd2460de7 ("librbd/object_map: diff state machine
should track object existence"), (3) was handled incorrectly (diff set
to DIFF_STATE_NONE instead of DIFF_STATE_UPDATED).

Post commit 399a45e11332 ("librbd/object_map: rbd diff between two
snapshots lists entire image content"), (4) is handled incorrectly
(diff set to DIFF_STATE_DATA instead of DIFF_STATE_DATA_UPDATED).

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

19 months agotest/librbd: expand DiffIterateTest.DiffIterateDiscard
Ilya Dryomov [Thu, 30 Nov 2023 16:30:33 +0000 (17:30 +0100)]
test/librbd: expand DiffIterateTest.DiffIterateDiscard

Similar to DiffIterateTest.DiffIterateDeterministic, systematically
cover the most common cases involving full-object discards.  With this
in place, issue [1] can be reproduced by any of:

    (preparatory) before snap3 is taken
    (1) beginning of time -> HEAD
    (2) snap1 -> HEAD
    (5) beginning of time -> snap3
    (6) snap1 -> snap3

Sub-object discards aren't covered here because of further issues
[2][3].

[1] https://tracker.ceph.com/issues/53897
[2] https://tracker.ceph.com/issues/63770
[3] https://tracker.ceph.com/issues/63771

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

19 months agolibrbd: resurrect "exists" assert in simple_diff_cb()
Ilya Dryomov [Fri, 10 Nov 2023 10:14:42 +0000 (11:14 +0100)]
librbd: resurrect "exists" assert in simple_diff_cb()

This effectively reverts commit 3ccc3bb4bd35 ("librbd: diff_iterate
needs to handle holes in parent images") which just dropped the assert
instead of addressing the root cause of reported crashes.

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

19 months agolibrbd: diff-iterate shouldn't ever report "new hole" against a hole
Ilya Dryomov [Thu, 9 Nov 2023 19:44:18 +0000 (20:44 +0100)]
librbd: diff-iterate shouldn't ever report "new hole" against a hole

If an object doesn't exist in both start and end versions but there is
an intermediate snapshot which contains it (i.e. the object is written
to and captured at some point but then discarded prior to or in the end
version), diff-iterate reports "new hole" -- callback is invoked with
exists=false.  This occurs both on the slow list_snaps path and in
fast-diff mode.

Despite going all the way back to the introduction of diff-iterate in
commit 0296c7cdae91 ("librbd: implement diff_iterate"), this behavior
is wrong and contradicts diff-iterate API documentation added in commit
a69532e86450 ("librbd: document diff_iterate in header") in the same
series:

    If the source snapshot name is NULL, we interpret that as
    the beginning of time and return all allocated regions of the
    image.

It also triggered an assert added in commit c680531e070a ("librbd:
change diff_iterate interface to be more C-friendly") in the same
series.  Unfortunately, commit f1f6407221a0 ("test_librbd: add
diff_iterate test including discard"), also part of the same series,
added a test which expected the wrong behavior.  Very confusing!

A year later, a different manifestation of this bug was fixed in commit
9a1ab95176fe ("rbd: Fix rbd diff for non-existent objects"), but the
fix only covered the case where calc_snap_set_diff() goes past the end
snap ID while processing clones.  The case where it runs out of clones
to process before reaching the end snap ID remained mishandled.

A year after that, commit 3ccc3bb4bd35 ("librbd: diff_iterate needs to
handle holes in parent images") dropped the assert mentioned above and
this bug got enshrined in the newly introduced fast-diff mode.

Finally, a few years later, deep-copy actually started relying on this
bug in commit e5a21e904142 ("librbd: deep-copy image copy state machine
skips clean objects").  This necessitates bifurcation in DiffRequest
because deep-copy wants the "has this object been touched" semantics,
which is different from diff-iterate (and also potentially much more
expensive to produce!).

This commit brings a minimal update to TestMockObjectMapDiffRequest
tests and DiffIterateTest.DiffIterateDiscard.  Coverage is expanded in
the following commits.

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

19 months agomds: set the loner to true for LOCK_EXCL_XSYN 54912/head
Xiubo Li [Mon, 27 Nov 2023 07:55:42 +0000 (15:55 +0800)]
mds: set the loner to true for LOCK_EXCL_XSYN

For filelock when in LOCK_EXCL_XSYN state the non-loner clients
should be issued empty caps, but since the loner of this state
is set to false and it could make the Locker to issue the Fcb caps
to them, which is incorrect.

This fix will just set the loner to true.

Fixes: https://tracker.ceph.com/issues/63646
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 1766a354278706eea560cb989796cc97dbef8b4b)

19 months agoqa/cephadm: update rhel symlinks in rados/cephadm/smoke/distro 54901/head
Casey Bodley [Thu, 14 Dec 2023 23:08:32 +0000 (18:08 -0500)]
qa/cephadm: update rhel symlinks in rados/cephadm/smoke/distro

Signed-off-by: Casey Bodley <cbodley@redhat.com>
19 months agoqa: Default to RHEL8.6 instead of 8.5
David Galloway [Wed, 8 Jun 2022 19:07:09 +0000 (15:07 -0400)]
qa: Default to RHEL8.6 instead of 8.5

Signed-off-by: David Galloway <dgallowa@redhat.com>
(cherry picked from commit b8c4488c558e1f824af1aae3fa14ac7ae1a366b1)

Conflicts:
qa/distros/container-hosts/ stuff was under qa/distros/podman/
qa/suites/fs/workload/0-rhel_8.yaml does not exist

19 months agoqa: Latest RHEL8 -> RHEL8.5
David Galloway [Thu, 31 Mar 2022 16:13:19 +0000 (12:13 -0400)]
qa: Latest RHEL8 -> RHEL8.5

Signed-off-by: David Galloway <dgallowa@redhat.com>
(cherry picked from commit fcd512b50b03f3a10c971bb224fc53dbcb45d78b)

Conflicts:
qa/distros/container-hosts/ stuff was under qa/distros/podman/
qa/suites/fs/workload/0-rhel_8.yaml does not exist

19 months agoMerge pull request #54860 from idryomov/wip-63654-pacific
Yuri Weinstein [Tue, 12 Dec 2023 19:19:11 +0000 (11:19 -0800)]
Merge pull request #54860 from idryomov/wip-63654-pacific

pacific: librbd: fix regressions in ObjectListSnapsRequest

Reviewed-by: Mykola Golub <mgolub@suse.com>
Reviewed-by: Ramana Raja <rraja@redhat.com>
19 months agoMerge pull request #54859 from idryomov/wip-journaling-test-fixups-pacific
Yuri Weinstein [Tue, 12 Dec 2023 19:18:13 +0000 (11:18 -0800)]
Merge pull request #54859 from idryomov/wip-journaling-test-fixups-pacific

pacific: test/librbd: avoid config-related crashes in DiscardWithPruneWriteOverlap

Reviewed-by: Mykola Golub <mgolub@suse.com>
19 months agoMerge pull request #49093 from cfsnyder/wip-54497-pacific
Yuri Weinstein [Mon, 11 Dec 2023 19:07:58 +0000 (11:07 -0800)]
Merge pull request #49093 from cfsnyder/wip-54497-pacific

pacific: rgw: prevent spurious/lost notifications in the index completion thread

Reviewed-by: Casey Bodley <cbodley@redhat.com>
19 months agotest/librbd: close image in DiffIterateDeterministic 54860/head
Ilya Dryomov [Sat, 9 Dec 2023 15:26:25 +0000 (16:26 +0100)]
test/librbd: close image in DiffIterateDeterministic

... to avoid valgrind reporting a memory leak on ImageCtx.

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

19 months agotest/librbd: drop DiffIterateTest.DiffIterateRegression6926
Ilya Dryomov [Fri, 1 Dec 2023 17:29:12 +0000 (18:29 +0100)]
test/librbd: drop DiffIterateTest.DiffIterateRegression6926

This was added to test [1].  It's duplicated by several cases in
DiffIterateTest.DiffIterateDeterministicPP now.  Specifically, the
issue could be reproduced by any of:

    (8) beginning of time -> snap2
    (9) snap1 -> snap2
    (10) beginning of time -> snap1

[1] https://tracker.ceph.com/issues/6926

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

19 months agotest/librbd: drop TestLibRBD.SnapDiff
Ilya Dryomov [Fri, 1 Dec 2023 17:54:19 +0000 (18:54 +0100)]
test/librbd: drop TestLibRBD.SnapDiff

This was added to integration test [1], separate from the fix which
went in only with unit test adjustments.  It's duplicated by several
cases in DiffIterateTest.DiffIterateDeterministic now.  Specifically,
the issue could be reproduced by any of:

    (3) snap2 -> HEAD
    (4) snap3 -> HEAD
    (7) snap2 -> snap3

[1] https://tracker.ceph.com/issues/50787

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

19 months agotest/librbd: add DiffIterateTest.DiffIterateDeterministic{,PP}
Ilya Dryomov [Wed, 29 Nov 2023 11:28:51 +0000 (12:28 +0100)]
test/librbd: add DiffIterateTest.DiffIterateDeterministic{,PP}

scribble()-based DiffIterate tests are too weak: at least two
regressions that should been caught by DiffIterate.DiffIterate or
DiffIterate.DiffIterateStress were missed [1][2].  Aside from the
randomness which can be both a good and a bad thing, asserts there
ensure only that the returned diff covers all changes that were made.
If the returned diff is too excessive or otherwise bogus, this isn't
detected [3].

Add a deterministic test to systematically cover the most common cases
that don't involve discards.  A similar test for discards will be added
with the fix for [4].

Comment out debug log in vector_iterate_cb() like it's done in
iterate_cb().

[1] https://tracker.ceph.com/issues/50787
[2] https://tracker.ceph.com/issues/63654
[3] https://tracker.ceph.com/issues/63719
[4] https://tracker.ceph.com/issues/53897

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

19 months agolibrbd: fix read_whole_object handling in ObjectListSnapsRequest
Ilya Dryomov [Mon, 27 Nov 2023 10:59:26 +0000 (11:59 +0100)]
librbd: fix read_whole_object handling in ObjectListSnapsRequest

Originally, in commit 2be4840afd4f ("librados/snap_set_diff: don't
assert on empty snapset"), exists was set to true.  This didn't make
ObjectListSnapsRequest, causing the following deep-copy tests to fail
when run against calc_snap_set_diff() rigged to return "whole object"
as described in [1]:

    TestDeepCopy.Snaps
    TestDeepCopy.SnapDiscard
    TestDeepCopy.CloneHideParent
    TestDeepCopy.Snaps_LargerDstObjSize
    TestDeepCopy.Snaps_SmallerDstObjSize

This is a regression introduced in commit cc87a8bd697e ("librbd:
deep-copy object utilizes image-extent IO methods") by way of commit
11923e234efc ("librbd: generic object list snapshot request").

[1] https://github.com/ceph/ceph/pull/20648#issuecomment-369292309

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

19 months agolibrbd: fix LIST_SNAPS_FLAG_WHOLE_OBJECT behavior
Ilya Dryomov [Mon, 27 Nov 2023 09:11:52 +0000 (10:11 +0100)]
librbd: fix LIST_SNAPS_FLAG_WHOLE_OBJECT behavior

Bundling read_whole_object and LIST_SNAPS_FLAG_WHOLE_OBJECT cases
together is wrong:

- In read_whole_object case, calc_snap_set_diff() sets just
  read_whole_object.  Everything else is zeroed out and may require
  resetting to fit with the rest of ObjectListSnapsRequest logic.

- In LIST_SNAPS_FLAG_WHOLE_OBJECT case, only the diff should be
  expanded.  Everything else is set by calc_snap_set_diff() and should
  be used as is.  This goes for end_size in particular -- if it's reset
  to object size, bogus zero extents may be returned as the object
  would appear to have grown.

This is a regression introduced in commit 4429ed4f3f4c ("librbd: switch
diff iterate API to use new snaps list dispatch methods") by way of
commit 66dd53d9c4d9 ("librbd: optionally return full object extent for
any snapshot deltas").

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

19 months agotest/librbd: make ListSnapsWholeObject actually test stuff
Ilya Dryomov [Sun, 19 Nov 2023 21:44:28 +0000 (22:44 +0100)]
test/librbd: make ListSnapsWholeObject actually test stuff

Despite being added in commit 66dd53d9c4d9 ("librbd: optionally return
full object extent for any snapshot deltas") ostensibly to test the new
LIST_SNAPS_FLAG_WHOLE_OBJECT code, it surely doesn't do that because
the flag isn't even passed to MockObjectListSnapsRequest::create().

I can only guess, but it looks like snap ID 3 was intended to be
a starting point.  Otherwise, with 0 and CEPH_NOSNAP passed as snap
IDs, the overlap that is set up for the clone wouldn't affect the
computation in any way.

Use snap ID 3 as a starting point and run both with and without
LIST_SNAPS_FLAG_WHOLE_OBJECT on the same snapset to pinpoint the
difference.

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

19 months agolibrados/snap_set_diff: set end_size only if end object exists
Ilya Dryomov [Sat, 11 Nov 2023 13:15:49 +0000 (14:15 +0100)]
librados/snap_set_diff: set end_size only if end object exists

Since commit 73f50a13109f ("rbd-mirror: use generalized deep copy for
image sync"), the only user of calc_snap_set_diff() immediately unsets
end_size otherwise.

calc_snap_set_diff() semantics are clearer if end_size is set together
with end_exists and clone_end_snap_id.

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

19 months agotest/librbd: actually alternate overlaps in DiscardWithPruneWriteOverlap 54859/head
Ilya Dryomov [Sat, 9 Dec 2023 20:00:51 +0000 (21:00 +0100)]
test/librbd: actually alternate overlaps in DiscardWithPruneWriteOverlap

Make sense of the inner loop in write_thread.  The crash on
"it != m_events.end()" assert reproduces even faster this way.

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

19 months agotest/librbd: avoid config-related crashes in DiscardWithPruneWriteOverlap
Ilya Dryomov [Sat, 9 Dec 2023 20:00:42 +0000 (21:00 +0100)]
test/librbd: avoid config-related crashes in DiscardWithPruneWriteOverlap

For reasons that I think no longer apply today, set_val() and
set_val_or_die() refuse to set "type: str" config options that aren't
marked as "can be changed at runtime" -- set_val() returns an error and
set_val_or_die() terminates the process.  What is and isn't marked as
"can be changed at runtime" seems to be pretty much random both within
and outside of RBD, so let's just refactor how config is set here.

While at it, I realized that reproducer config is underspecified:

- for rbd_cache_policy and rbd_cache_writethrough_until_flush settings
  to matter, rbd_cache must be set to true and rbd_cache_max_dirty must
  be set to a positive number

- order should be set explicitly, because rbd_default_order can be as
  low as 12 (for 4096-byte objects), interfering with the logic of the
  test

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

19 months agoMerge pull request #54820 from baergj/wip-63745-pacific
Yuri Weinstein [Fri, 8 Dec 2023 21:25:55 +0000 (13:25 -0800)]
Merge pull request #54820 from baergj/wip-63745-pacific

pacific: librbd: Append one journal event per image request

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
19 months agoMerge pull request #54782 from ifed01/wip-ifed-fix-63606
Yuri Weinstein [Thu, 7 Dec 2023 16:31:47 +0000 (08:31 -0800)]
Merge pull request #54782 from ifed01/wip-ifed-fix-63606

pacific: test/store_test: adjust physical extents to inject error against

Reviewed-by: Adam Kupczyk <akupczyk@redhat.com>
19 months agoMerge pull request #54771 from ajarr/wip-63714-pacific
Yuri Weinstein [Thu, 7 Dec 2023 16:30:34 +0000 (08:30 -0800)]
Merge pull request #54771 from ajarr/wip-63714-pacific

pacific: qa/workunits/rbd/cli_generic.sh: narrow race window when checking that rbd_support module command fails after blocklisting the module's client

Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
19 months agoMerge pull request #53581 from adk3798/pacific-c-v-data-allocate
Yuri Weinstein [Thu, 7 Dec 2023 16:30:07 +0000 (08:30 -0800)]
Merge pull request #53581 from adk3798/pacific-c-v-data-allocate

pacific: ceph-volume,python-common: Data allocate fraction

Reviewed-by: Guillaume Abrioux <gabrioux@redhat.com>
19 months agoMerge pull request #52533 from idryomov/wip-61733-pacific
Yuri Weinstein [Thu, 7 Dec 2023 16:27:58 +0000 (08:27 -0800)]
Merge pull request #52533 from idryomov/wip-61733-pacific

pacific: mon/MonClient: resurrect original client_mount_timeout handling

Reviewed-by: Sridhar Seshasayee <sseshasa@redhat.com>
19 months agorgw: initialize RGWIndexCompletionManager thread after related members 49093/head
Casey Bodley [Mon, 7 Mar 2022 20:10:07 +0000 (15:10 -0500)]
rgw: initialize RGWIndexCompletionManager thread after related members

resolves valgrind issues about RGWIndexCompletionManager::process()
using uninitialized memory

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 112c2608750cf8db2c52c8e89f5897080501f6bd)

19 months agorgw: prevent spurious/lost notifications in the index completion thread
Yuval Lifshitz [Wed, 23 Feb 2022 15:21:10 +0000 (17:21 +0200)]
rgw: prevent spurious/lost notifications in the index completion thread

this was happening when asyn completions happened during reshard.
more information about testing:
https://gist.github.com/yuvalif/d526c0a3a4c5b245b9e951a6c5a10517

we also add more logs to the completion manager.
should allow finding unhandled completions due to reshards.

Fixes: https://tracker.ceph.com/issues/54435
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit e72b6510a402cbafa6c99475626f15d97fd00f86)

19 months agotest/librbd: Add workaround for a journaling deadlock that this test exposes 54820/head
Joshua Baergen [Wed, 29 Nov 2023 15:47:01 +0000 (08:47 -0700)]
test/librbd: Add workaround for a journaling deadlock that this test exposes

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit 7436b4c99034dd19b2ff1e759603779061cbfdb6)

19 months agolibrbd: Append one journal event per image request
Joshua Baergen [Thu, 9 Nov 2023 16:43:22 +0000 (09:43 -0700)]
librbd: Append one journal event per image request

In the case where an image request is split across multiple object
extents and journaling is enabled, multiple journal events are appended.
Prior to this change, all object requests would wait for the last
journal event to complete, since journal events complete in order and
thus the last one completing implies that all prior journal events were
safe at that point.

The issue with this is that there's nothing stopping that last journal
event from being cleaned up before all object requests have stopped
referring to it. Thus, it's entirely possible for the following sequence
to occur:
1. An image request gets split into two image extents and two object
   requests. Journal events are appended (one per image extent).
2. The first object request gets delayed due to an overlap, but the
   second object request gets submitted and starts waiting on the last
   journal event (which also causes a C_CommitIOEvent to be instantiated
   against that journal event).
3. Journaling completes, and the C_CommitIOEvent fires. The
   C_CommitIOEvent covers the entire range of data that was journaled in
   this event, and so the event is cleaned up.
4. The first object request from above is allowed to make progress; it
   tries to wait for the journal event that was just cleaned up which
   causes the assert in wait_event() to fire.

As far as I can tell, this is only possible on the discard path today,
and only recently. Up until 21a26a752843295ff946d1543c2f5f9fac764593
(librbd: Fix local rbd mirror journals growing forever), m_image_extents
always contained a single extent for all I/O types; this commit changed
the discard path so that if discard granularity changed the discard
request, m_image_extents would be repopulated, and if the request
happened to cross objects then there would be multiple m_image_extents.

It appears that the intent here was that there should be one journal
event per image request and the pending_extents kept track of what had
completed thus far. This commit restores that 1:1 relationship.

Fixes: https://tracker.ceph.com/issues/63422
Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit 4a8fa2da72fe64109073fddca0d4cfd99aeb9c77)

19 months agolibrbd: Change append_io_events() to take Extents
Joshua Baergen [Thu, 9 Nov 2023 16:43:21 +0000 (09:43 -0700)]
librbd: Change append_io_events() to take Extents

An upcoming commits will use this to change how multi-extent image
requests are appended to the journal.

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit 9fae091ea22c627cb18cc68055afa7acf634c1b7)

19 months agolibrbd: Eliminate unused m_synchronous from AbstractImageWriteRequest
Joshua Baergen [Thu, 9 Nov 2023 16:43:20 +0000 (09:43 -0700)]
librbd: Eliminate unused m_synchronous from AbstractImageWriteRequest

This has been unused since its introduction years ago and so isn't worth
keeping.

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit a0ccd8bb3ffbecb3313c0cdd7d3e6091fc2a9721)

19 months agotest/librbd: Add a stress test that reproduces a crash during discard journaling
Joshua Baergen [Thu, 9 Nov 2023 16:43:19 +0000 (09:43 -0700)]
test/librbd: Add a stress test that reproduces a crash during discard journaling

See the comments in DiscardWithPruneWriteOverlap for details.

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
(cherry picked from commit e8d54e3c9faeddedc2890294556cd66095b83be4)

19 months agoMerge pull request #54517 from lxbsz/wip-63513
Yuri Weinstein [Tue, 5 Dec 2023 19:10:15 +0000 (11:10 -0800)]
Merge pull request #54517 from lxbsz/wip-63513

pacific: mds: fix issuing redundant reintegrate/migrate_stray requests

Reviewed-by: Kotresh HR khiremat@redhat.com
19 months agoMerge pull request #50533 from k0ste/wip-55613-pacific
Yuri Weinstein [Tue, 5 Dec 2023 19:09:18 +0000 (11:09 -0800)]
Merge pull request #50533 from k0ste/wip-55613-pacific

pacific: RGW - Fix NoSuchTagSet error

Reviewed-by: Casey Bodley <cbodley@redhat.com>
19 months agoMerge pull request #44476 from pritha-srivastava/wip-52784-pacific
Yuri Weinstein [Tue, 5 Dec 2023 19:08:40 +0000 (11:08 -0800)]
Merge pull request #44476 from pritha-srivastava/wip-52784-pacific

pacific: rgw/sts: createbucket op should take session_policies into account

Reviewed-by: Casey Bodley <cbodley@redhat.com>
19 months agoMerge pull request #52763 from dparmar18/wip-61732
Yuri Weinstein [Tue, 5 Dec 2023 16:37:59 +0000 (08:37 -0800)]
Merge pull request #52763 from dparmar18/wip-61732

pacific: qa: pass arg as list to fix test case failure

Reviewed-by: Kotresh HR khiremat@redhat.com
19 months agoMerge pull request #54713 from mchangir/wip-63588-pacific
Yuri Weinstein [Tue, 5 Dec 2023 16:20:40 +0000 (08:20 -0800)]
Merge pull request #54713 from mchangir/wip-63588-pacific

pacific: qa: run kernel_untar_build with newer tarball

Reviewed-by: Kotresh HR khiremat@redhat.com
19 months agoMerge pull request #54472 from lxbsz/wip-63512
Yuri Weinstein [Tue, 5 Dec 2023 16:18:23 +0000 (08:18 -0800)]
Merge pull request #54472 from lxbsz/wip-63512

pacific: client: queue a delay cap flushing if there are ditry caps/snapcaps

Reviewed-by: Kotresh HR khiremat@redhat.com
19 months agoMerge pull request #54033 from vshankar/wip-63173-pacific
Yuri Weinstein [Tue, 5 Dec 2023 16:17:40 +0000 (08:17 -0800)]
Merge pull request #54033 from vshankar/wip-63173-pacific

pacific: mds: adjust pre_segments_size for MDLog when trimming segments for st…

Reviewed-by: Kotresh HR khiremat@redhat.com
19 months agoMerge pull request #53981 from lxbsz/wip-62916
Yuri Weinstein [Tue, 5 Dec 2023 16:16:40 +0000 (08:16 -0800)]
Merge pull request #53981 from lxbsz/wip-62916

pacific: client: fix sync fs to force flush mdlog for all sessions

Reviewed-by: Kotresh HR khiremat@redhat.com
Reviewed-by: Venky Shankar <vshankar@redhat.com>
19 months agoMerge pull request #53574 from kotreshhr/wip-62406-pacific
Yuri Weinstein [Tue, 5 Dec 2023 16:14:46 +0000 (08:14 -0800)]
Merge pull request #53574 from kotreshhr/wip-62406-pacific

pacific:    mgr/volumes: Fix pending_subvolume_deletions in volume info

Reviewed-by: Kotresh HR khiremat@redhat.com
19 months agotest/store_test: adjust physical extents to inject error against 54782/head
Igor Fedotov [Tue, 5 Dec 2023 11:03:53 +0000 (14:03 +0300)]
test/store_test: adjust physical extents to inject error against

Fixes: https://tracker.ceph.com/issues/63606
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
19 months agoMerge pull request #52987 from leonid-s-usov/backport/strip-nofail/pacific
Rishabh Dave [Tue, 5 Dec 2023 06:34:10 +0000 (12:04 +0530)]
Merge pull request #52987 from leonid-s-usov/backport/strip-nofail/pacific

pacific: nofail option in fstab not supported

Reviewed-by: Rishabh Dave <ridave@redhat.com>
19 months agomds: fix issuing redundant reintegrate/migrate_stray requests 54517/head
Xiubo Li [Fri, 15 Sep 2023 00:41:35 +0000 (08:41 +0800)]
mds: fix issuing redundant reintegrate/migrate_stray requests

Just in case a CInode's nlink is 1, and then a unlink request comes
and then early replies and submits to the MDLogs, but just before
the MDlogs are flushed a link request comes, and the link request
also succeeds and early replies to client.

Later when the unlink/link requests' MDLog events are flushed and
the callbacks are called, which will fire a stray denty reintegration.
But it will pick the new dentry, which is from the link's request
and is a remote dentry, to do the reintegration. While in the
'rename' code when traversing the path it will trigger to call the
'dn->link_remote()', which later will fire a new stray dentry
reintegration.

The problem is if the first 'rename' request is retried several
times, and in each time it will fire a new reintegration, which
makes no sense and maybe blocked for a very long time dues to some
reasons and then will be reported as slow request warning.

Fixes: https://tracker.ceph.com/issues/62702
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 53d9e657e42bdf2440cd93a8273eb3ce79d8bd33)

19 months agomds: record the internal client request and receive client reply
Xiubo Li [Fri, 15 Sep 2023 00:41:35 +0000 (08:41 +0800)]
mds: record the internal client request and receive client reply

This will be used to avoid possible multiple reintegration issue
later.

Fixes: https://tracker.ceph.com/issues/62702
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 723c1b7c9e773a68b6c2586155092ca95ab4f3e7)

Conflicts: with commit 7243b680526 ("mds: ensure next replay is
queued on req drop")

19 months agoMerge pull request #54314 from batrick/wip-63419-pacific
Yuri Weinstein [Mon, 4 Dec 2023 19:35:48 +0000 (11:35 -0800)]
Merge pull request #54314 from batrick/wip-63419-pacific

pacific: mds: ensure next replay is queued on req drop

Reviewed-by: Rishabh Dave <ridave@redhat.com>
19 months agoqa/workunits/rbd/cli_generic.sh: narrow race window 54771/head
Ramana Raja [Wed, 29 Nov 2023 16:25:30 +0000 (11:25 -0500)]
qa/workunits/rbd/cli_generic.sh: narrow race window

... when checking whether a rbd_support module command fails after
blocklisting the module's client.

In tests that check the recovery of the rbd_support module after its
client is blocklisted, the rbd_support module's client is
blocklisted using the `osd blocklist add` command. Next,
`osd blocklist ls` command is issued to confirm that the client is
blocklisted. A rbd_support module command is then issued and expected
to fail in order to verify that the blocklisting has affected the
rbd_support module's operations. Sometimes it was observed that before
this rbd_support module command reached the ceph-mgr, the rbd_support
module detected the blocklisting, recovered from it, and was able to
serve the command. To reduce the race window that occurs when trying to
verify that the rbd_support module's operation is affected by client
blocklisting, get rid of the `osd blocklist ls` command.

Fixes: https://tracker.ceph.com/issues/63673
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit ea033fe8607c2b31892536afc3f08f3009b24139)

19 months agoMerge pull request #54593 from idryomov/wip-53593-pacific
Yuri Weinstein [Mon, 4 Dec 2023 15:54:31 +0000 (07:54 -0800)]
Merge pull request #54593 from idryomov/wip-53593-pacific

pacific: osd: don't require RWEXCL lock for stat+write ops.

Reviewed-by: Laura Flores <lflores@redhat.com>
19 months agoMerge pull request #52993 from k0ste/wip-57474-pacific
Yuri Weinstein [Mon, 4 Dec 2023 15:53:28 +0000 (07:53 -0800)]
Merge pull request #52993 from k0ste/wip-57474-pacific

pacific: mgr: fix a race condition in DaemonServer::handle_report()

Reviewed-by: Laura Flores <lflores@redhat.com>
19 months agoMerge pull request #51259 from k0ste/wip-52557-pacific
Yuri Weinstein [Mon, 4 Dec 2023 15:52:40 +0000 (07:52 -0800)]
Merge pull request #51259 from k0ste/wip-52557-pacific

pacific: pybind/rados: don't close watch in dealloc if already closed

Reviewed-by: Laura Flores <lflores@redhat.com>
19 months agoMerge pull request #54039 from vshankar/wip-61829-pacific
Yuri Weinstein [Fri, 1 Dec 2023 17:22:36 +0000 (09:22 -0800)]
Merge pull request #54039 from vshankar/wip-61829-pacific

pacific: qa: assign file system affinity for replaced MDS

Reviewed-by: Laura Flores <lflores@redhat.com>