New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbd-mirror: guard the deletion of non-primary images #16398

Merged
merged 4 commits into from Jul 27, 2017

Conversation

Projects
None yet
3 participants
@dillaman
Contributor

dillaman commented Jul 18, 2017

The deletion of a non-primary should only occur if it's associated with a deleted remote image or if a resync has been requested. If an image is orphaned or split-brained from a remote image, the remote deletion shouldn't propagate.

@vshankar vshankar requested review from vshankar, trociny and rjfd Jul 21, 2017

@dillaman

This comment has been minimized.

Contributor

dillaman commented Jul 24, 2017

rebased

C_SaferCond ctx;
m_deleter->wait_for_scheduled_deletion(m_local_pool_id, GLOBAL_IMAGE_ID,
&ctx);
EXPECT_EQ(-rbd::mirror::ImageDeleter::EISPRM, ctx.wait());

This comment has been minimized.

@vshankar

vshankar Jul 25, 2017

Contributor

Should be templated: -rbd::mirror::ImageDeleter<>::EISPRM

<< "trash, failed to retrieve image name: "
<< cpp_strerror(*result) << dendl;
}
if (*result == -ENOENT) {

This comment has been minimized.

@rjfd

rjfd Jul 25, 2017

Contributor

Why not move the error message in the "then" branch to the conditional block above, and just keep the code of the "else" branch by changing this condition to *result != -ENOENT?

This comment has been minimized.

@dillaman

dillaman Jul 25, 2017

Contributor

Preference, I guess so it doesn't separate the fall-through logic.

@vshankar

This comment has been minimized.

Contributor

vshankar commented Jul 25, 2017

Seems like missing changes to test/rbd_mirror/test_mock_ImageReplayer.cc and test/rbd_mirror/test_mock_InstanceReplayer.cc wrt the addition of ignore_orphaned parameter in schedule_image_delete().

dillaman added some commits Jul 18, 2017

rbd-mirror: ensure derived image removals are associated to remote peer
If the remote pool image listing is retrieved before the local pool image
listing, the derived image removals would incorrectly be associated with
the local peer.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: log message cleanup
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/workunits/rbd: rbd-mirror now treats no primary image as unknown s…
…tate

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd-mirror: image deletion should ensure journal is owned by remote peer
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@dillaman

This comment has been minimized.

Contributor

dillaman commented Jul 25, 2017

whoops -- missed the unit tests. rebase pushed.

@vshankar

This comment has been minimized.

Contributor

vshankar commented Jul 26, 2017

@ceph-jenkins retest this please

@vshankar vshankar self-assigned this Jul 26, 2017

@vshankar

This comment has been minimized.

Contributor

vshankar commented Jul 26, 2017

LGTM

@vshankar

This comment has been minimized.

Contributor

vshankar commented Jul 27, 2017

re-running failed tests after merging #16603

@dillaman dillaman merged commit 42fabc2 into ceph:master Jul 27, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@dillaman dillaman deleted the dillaman:wip-20655 branch Jul 27, 2017

@dillaman

This comment has been minimized.

Contributor

dillaman commented Jul 27, 2017

All related tests passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment