Skip to content

Commit

Permalink
rbd-mirror: gracefully fail if object map is unavailable
Browse files Browse the repository at this point in the history
If the exclusive lock was lost due to a watch failure from an
overloaded cluster, gracefully abort the image sync.

Fixes: http://tracker.ceph.com/issues/16558
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 6f573ca)
  • Loading branch information
Jason Dillaman authored and ldachary committed Aug 10, 2016
1 parent aacb793 commit 8316b6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tools/rbd_mirror/image_sync/ObjectCopyRequest.cc
Expand Up @@ -235,6 +235,13 @@ void ObjectCopyRequest<I>::send_update_object_map() {
m_local_image_ctx->snap_lock.put_read();
finish(0);
return;
} else if (m_local_image_ctx->object_map == nullptr) {
// possible that exclusive lock was lost in background
derr << ": object map is not initialized" << dendl;

m_local_image_ctx->snap_lock.put_read();
finish(-EINVAL);
return;
}

assert(m_local_image_ctx->object_map != nullptr);
Expand Down

0 comments on commit 8316b6a

Please sign in to comment.