Skip to content

reef: RBD backports (batch 2) - #51518

Merged
idryomov merged 12 commits into
ceph:reeffrom
idryomov:wip-rbd-reef-backports-2
May 19, 2023
Merged

idryomov merged 12 commits into
ceph:reeffrom
idryomov:wip-rbd-reef-backports-2

Conversation

@idryomov

@idryomov idryomov commented May 16, 2023 •

Copy link
Copy Markdown
Contributor

Backport #49742, #50324, #51166, #51264, #51279, #51297 and #51454 to reef.

Prasanna Kumar Kalever and others added 11 commits May 16, 2023 22:15
…y creating a new one

Problem:
-------
At a high level, creating a primary snapshot consists of three steps:

1. actually creating a snapshot in the mirror namespace
2. generating a set of image state objects with additional metadata for
   the snapshot
3. marking the snapshot as complete after the image state objects are
   written out

Depending on the circumstances, a request to create a primary snapshot
can be forwarded to rbd-mirror daemon.  If that happens and rbd-mirror
daemon gets axed for some practical reason after completing steps (1)
and/or (2) but before completing step (3), we are left with a
permanently incomplete primary snapshot because upon retrying that
primary snapshot creation request, librbd notices that such snapshot
already exists.  It does not check whether this "pre-existing" snapshot
is complete.

Solution:
--------
As part of the next mirror snapshot create (say triggered by the
scheduler) the unlink_peer() is called, it checks if there exists any
incomplete snapshot and delete them accordingly.

Fixes: https://tracker.ceph.com/issues/58887
Signed-off-by: Prasanna Kumar Kalever <[email protected]>
(cherry picked from commit 165c9a4)
Up until now this was conditioned on whether the caller expressed
interest in the ID of the created snapshot and happened to work only
because CreatePrimaryRequest wasn't actually consulting any mirror
snapshot metadata.  This has just changed with unlink_peer() needing to
see an up-to-date complete flag which is set in SetImageStateRequest
following the write out of image state object(s).

Signed-off-by: Ilya Dryomov <[email protected]>
(cherry picked from commit df2bb13)
A client may attempt a lock request not quickly enough to
obtain exclusive lock for operations when another competing
client responds quicker. This can happen when a peer site has
different performance characteristics or latency. Instead of
relying on this unpredictable behavior, localize operation to
primary cluster.

Fixes: https://tracker.ceph.com/issues/59393
Signed-off-by: Christopher Hoffman <[email protected]>
(cherry picked from commit ac552c9)
The use of SUCCEED macro predates the introduction of GTEST_SKIP macro
to GTest 1.10.  Having skipped tests reported as passed is misleading!

Before:

[ RUN      ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild
SKIPPING
[       OK ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild (9 ms)
...
[ RUN      ] TestMockOperationSnapshotRemoveRequest.RemoveChildError
SKIPPING
[       OK ] TestMockOperationSnapshotRemoveRequest.RemoveChildError (112 ms)
...
[  PASSED  ] 16 tests.

After:

[ RUN      ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild
../src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc:381: Skipped
Skipping due to unmet REQUIRE
[  SKIPPED ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild (9 ms)
...
[ RUN      ] TestMockOperationSnapshotRemoveRequest.RemoveChildError
../src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc:727: Skipped
Skipping due to enabled deep-flatten
[  SKIPPED ] TestMockOperationSnapshotRemoveRequest.RemoveChildError (111 ms)
...
[  PASSED  ] 14 tests.
[  SKIPPED ] 2 tests, listed below:
[  SKIPPED ] TestMockOperationSnapshotRemoveRequest.FlattenedCloneRemovesChild
[  SKIPPED ] TestMockOperationSnapshotRemoveRequest.RemoveChildError

Signed-off-by: Ilya Dryomov <[email protected]>
(cherry picked from commit 472c7b6)
... requests to be completed.

Signed-off-by: Ramana Raja <[email protected]>
(cherry picked from commit 38a7e37)
Signed-off-by: Ramana Raja <[email protected]>
(cherry picked from commit e452899)
In certain scenarios the OSDs were slow to process RBD requests.
This lead to the rbd_support module's RBD client not being able to
gracefully handover a RBD exclusive lock to another RBD client.
After the condition persisted for some time, the other RBD client
forcefully acquired the lock by blocklisting the rbd_support module's
RBD client, and consequently blocklisted the module's RADOS client. The
rbd_support module stopped working. To recover the module, the entire
mgr service had to be restarted which reloaded other mgr modules.

Instead of recovering the rbd_support module from client blocklisting
by being disruptive to other mgr modules, recover the module
automatically without restarting the mgr serivce. On client getting
blocklisted, shutdown the module's handlers and blocklisted client,
create a new rados client for the module, and start the new handlers.

Fixes: https://tracker.ceph.com/issues/56724
Signed-off-by: Ramana Raja <[email protected]>
(cherry picked from commit cc04687)
... after the module's RADOS client is blocklisted.

Signed-off-by: Ramana Raja <[email protected]>
(cherry picked from commit a2f15d4)
Recover from being blocklisted while recovering from blocklisting.
When the rbd_support  module is being set up to recover from client
blocklisting, the module's new rados client connection can also get
blocklisted. Currently, this will cause the recovery to fail and
the module will remain inoperable. Instead, retry module recovery
when the new client gets blocklisted during the module setup in the
recovery thread.

Fixes: https://tracker.ceph.com/issues/59713
Signed-off-by: Ramana Raja <[email protected]>
(cherry picked from commit 4523d9b)
See:
`m_locker->address = iter->second.addr.get_legacy_str();`

In the case where `iter->second.addr` is an empty address,
m_locker->address string is assigned with "0)/0" and therfore
will never result in an empty string.

Use `is_blank_ip()` before `get_legacy_str()`

Signed-off-by: Matan Breizman <[email protected]>
(cherry picked from commit 7482bee)
Signed-off-by: Ilya Dryomov <[email protected]>
(cherry picked from commit 43f2e4a)
@idryomov idryomov added this to the reef milestone May 16, 2023
@idryomov
idryomov requested a review from a team as a code owner May 16, 2023 20:22
Currently:
2023-04-28T12:20:17.135+0530 7f1a7ccd2640 20 librbd::ExclusiveLock: 0x7f1a4c000b60 block_requestsr=0
[...]
2023-04-28T12:20:17.135+0530 7f1a7ccd2640 20 librbd::ManagedLock: 0x7f1a4c000b78 is_lock_owner: =1
[...]
2023-04-18T21:18:50.695+0530 7f0a1ffff640 20 librbd::ImageWatcher: 0x7f0a10007840 remote async request finished: [4305,140018014309120,1] = -110

Signed-off-by: Prasanna Kumar Kalever <[email protected]>
(cherry picked from commit e558ec5)
@idryomov

Copy link
Copy Markdown
Contributor Author

Added #51279

@chrisphoffman chrisphoffman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@idryomov
idryomov merged commit 0c519d0 into ceph:reef May 19, 2023
@idryomov
idryomov deleted the wip-rbd-reef-backports-2 branch May 19, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants