Skip to content

Commit

Permalink
librbd: force a copyup object map update if migration completes
Browse files Browse the repository at this point in the history
If a live-migration copyup was in-progress when the copyup completes,
force the object map to be updated.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit e18e413)
  • Loading branch information
Jason Dillaman committed May 15, 2019
1 parent 9ee462a commit f98c753
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librbd/io/CopyupRequest.cc
Expand Up @@ -552,6 +552,12 @@ bool CopyupRequest<I>::is_update_object_map_required(int r) {
return false;
}

if (m_image_ctx->migration_info.empty()) {
// migration might have completed while IO was in-flight,
// assume worst-case and perform an object map update
return true;
}

auto it = m_image_ctx->migration_info.snap_map.find(CEPH_NOSNAP);
ceph_assert(it != m_image_ctx->migration_info.snap_map.end());
return it->second[0] != CEPH_NOSNAP;
Expand Down

0 comments on commit f98c753

Please sign in to comment.