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: demote/promote all mirrored images in a pool #13758

Merged
merged 8 commits into from Mar 9, 2017

Conversation

Projects
None yet
2 participants
@dillaman
Contributor

dillaman commented Mar 3, 2017

No description provided.

@dillaman dillaman changed the title from rbd: demote/promote all mirrored images in a pool to [DNM] rbd: demote/promote all mirrored images in a pool Mar 3, 2017

@dillaman

This comment has been minimized.

Contributor

dillaman commented Mar 3, 2017

Currently fails the rbd-mirror workunit test

watcher/Types.cc
watcher/RewatchRequest.cc

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

It should be above Types.cc?

image_ids);
if (r < 0 && r != -ENOENT) {
lderr(cct) << "Error reading list of children from pool " << it->second
<< dendl;

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

indentation

&mirror_image_internal);
if (r < 0 && r != -ENOENT) {
lderr(cct) << "failed to retrieve mirroring state: " << cpp_strerror(r)
<< dendl;

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

identation

<< dendl;
return r;
} else if (mirror_image_internal.state !=
cls::rbd::MIRROR_IMAGE_STATE_ENABLED) {

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

not sure about indentation here

This comment has been minimized.

@dillaman

dillaman Mar 7, 2017

Contributor

looks good to me -- indented two spaces since it's a carryover from the line above

This comment has been minimized.

@trociny

trociny Mar 7, 2017

Contributor

ok. Just we have many examples in our code where it starts after the '(' above, i.e.:

if (x
    y)

And this is how Emacs indents to me.

This comment has been minimized.

@dillaman

dillaman Mar 7, 2017

Contributor

I always code with wrapped conditional clauses indented to show that they are grouped w/ the previous line. I.e.:

if (something_very_long !=
      something_else &&
    some_other_very_long_conditional_clause) {
  ...
}

vs

if (something_very_long !=
    something_else &&
    some_other_very_long_conditional_clause) {
  ...
}
do {
std::map<std::string, std::string> mirror_images;
r = cls_client::mirror_image_list(&io_ctx, last_read, max_read,
&mirror_images);

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

identation

&mirror_image_internal);
if (r < 0 && r != -ENOENT) {
lderr(cct) << "failed to retrieve mirroring state: " << cpp_strerror(r)
<< dendl;

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

identation

r = cls_client::mirror_image_status_get(&ictx->md_ctx, info.global_id, &s);
if (r < 0 && r != -ENOENT) {
lderr(cct) << "failed to retrieve image mirror status: "
<< cpp_strerror(r) << dendl;

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

identation

r = cls_client::mirror_mode_set(&io_ctx, next_mirror_mode);
if (r < 0) {
lderr(cct) << "Failed to set mirror mode: " << cpp_strerror(r) << dendl;

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

While here, there might be a sense to unify all messages to start lowercase?

peer.client_name));
ASSERT_EQ(0, librbd::api::Mirror<>::peer_add(ioctx, &uuid,
peer.cluster_name,
peer.client_name));

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

on github indentation looks wrong (needs an additional whitespace)?

This comment has been minimized.

@dillaman

dillaman Mar 7, 2017

Contributor

Looks correct in an editor -- just github not liking mixing tabs and spaces throughout the codebase

* DEMOTE *
* | *
* v *
* RELEASE_LOCK < * * *

This comment has been minimized.

@trociny

trociny Mar 6, 2017

Contributor

The error arrow from ACQUIRE_LOCK should go to <finish>?

@dillaman dillaman changed the title from [DNM] rbd: demote/promote all mirrored images in a pool to rbd: demote/promote all mirrored images in a pool Mar 7, 2017

@trociny trociny self-assigned this Mar 7, 2017

dillaman added some commits Feb 2, 2017

librbd: rename parent_spec/parent_info type to match code style specs
This also includes a consolidation of SnapInfo, ParentSpec, and ParentInfo
into a single header.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: move mirror-related API functions
Also ensure that the API helper methods can be tested via
mock test cases.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: move group and diff API functions
The group and diff_iterate API functions are already in separate
units, so it's trivial to move them to the new 'api' namespace.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: asynchronous journal demote state machine
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: additional asynchronous mirror state machines
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
librbd: add aio_mirror_image_* API methods
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd: new rbd mirror pool promote/demote actions
Fixes: http://tracker.ceph.com/issues/18748
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
doc: update RBD mirroring instructions for pool demotion/promotion
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@dillaman

This comment has been minimized.

Contributor

dillaman commented Mar 8, 2017

retest this please

1 similar comment
@dillaman

This comment has been minimized.

Contributor

dillaman commented Mar 9, 2017

retest this please

@trociny

trociny approved these changes Mar 9, 2017

@trociny trociny merged commit 05c56b2 into ceph:master Mar 9, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@dillaman dillaman deleted the dillaman:wip-18748 branch Mar 10, 2017

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