]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/ManagedLock: kickstart ExclusiveLock state machine 53920/head
authorRamana Raja <rraja@redhat.com>
Mon, 2 Oct 2023 16:39:26 +0000 (12:39 -0400)
committerRamana Raja <rraja@redhat.com>
Tue, 10 Oct 2023 12:44:59 +0000 (08:44 -0400)
commitf91318d19c8c4a8f7b8cd08d86127e5574069598
treea8da80c18ced954c92d92f9feb702a6843f0f20e
parent0efeca903f7058ac9567958c896d7ba87b02d35a
librbd/ManagedLock: kickstart ExclusiveLock state machine

... that is stalled waiting for lock. Do this when trying to reacquire
lock in the ImageWatcher's rewatch mechanism. This would enable the
ExclusiveLock state machine to propagate the blocklist error to the
caller trying to perform an image operation requiring an exclusive
lock.

Previous attempt, e66db763, to fix the hang due to exclusive lock
acquisiton (stuck waiting for lock) racing with client blocklisting
did not always work. e66db763 kickstarted the ExclusiveLock state
machine when the ImageWatcher tried to schedule a exclusive lock
request and the blocklisting was detected. However, there is a short
window between a watch getting deregistered and client blocklisting
getting detected as part of rewatching. If hit when trying to schedule
a lock request, the ExclusiveLock state machine wasn't kickstarted,
blocklist error wasn't propagated, and the hang resurfaced.

A more robust approach is taken to resume the ExclusiveLock state
machine stuck waiting for lock during client blocklisting. Whenever
a client's ImageWatcher loses connection to the cluster, as it happens
during blocklising, the ImageWatcher initiates a mechanism to rewatch
the image and tries to reacquire the lock. Piggyback on this rewatch
mechanism that gets triggered during client blocklisting. And when
trying to reacquire the lock, kickstart the ExclusiveLock state
machine stalled waiting for lock (STATE_WAITING_FOR_LOCK).

Fixes: https://tracker.ceph.com/issues/63009
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit 18b018578cf8ac51a7e7a7d25f62d7bde345461a)
src/librbd/ImageWatcher.cc
src/librbd/ManagedLock.cc