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: make it more understandable when adding peer returns error #16313

Merged
merged 1 commit into from Jul 21, 2017

Conversation

Projects
None yet
4 participants
@Songweibin
Contributor

Songweibin commented Jul 13, 2017

When adding peer for a disabled pool, the error return seems hard to understand.
[root@s247 ~]# rbd mirror pool peer add rbd client.admin@cluster
rbd: error adding mirror peer
2017-07-13 14:22:42.287189 7f606e888bc0 -1 librbd::api::Mirror: peer_add: failed to add mirror peer '0x7ffdbce45dc0': (22) Invalid argument
And now, it looks like that:
[root@s248 ~]# rbd mirror pool peer add p1 client.admin@cluster
rbd: error adding mirror peer
2017-07-13 14:52:22.740104 7f419822fbc0 -1 librbd::api::Mirror: peer_add: failed to add mirror peer: mirroring must be enabled on the pool

Signed-off-by: songweibin song.weibin@zte.com.cn

@xiexingguo xiexingguo requested a review from dillaman Jul 13, 2017

@tchaikov tchaikov changed the title from api/Mirror: make it more understandable when adding peer returns error to librbd: make it more understandable when adding peer returns error Jul 13, 2017

@dillaman

@Songweibin It's problematic to change the return code from cls_rbd since it will most likely break upgrade tests. Instead, in the rbd CLI you could just test to see if mirroring is enabled before invoking mirror_peer_add.

@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Jul 13, 2017

retest this please.

@Songweibin Songweibin changed the title from librbd: make it more understandable when adding peer returns error to tools/rbd: make it more understandable when adding peer returns error Jul 14, 2017

@Songweibin

This comment has been minimized.

Contributor

Songweibin commented Jul 14, 2017

@dillaman Modified and updated as your suggestion, would you please have a look? Thanks.

@@ -528,6 +529,21 @@ int execute_peer_add(const po::variables_map &vm) {
if (r < 0) {
return r;
}
cls::rbd::MirrorMode mirror_mode;
r = librbd::cls_client::mirror_mode_get(&io_ctx, &mirror_mode);

This comment has been minimized.

@dillaman

dillaman Jul 17, 2017

Contributor

Use the librbd public API -- librbd::RBD::mirror_mode_get

@dillaman dillaman changed the title from tools/rbd: make it more understandable when adding peer returns error to rbd: make it more understandable when adding peer returns error Jul 17, 2017

api/Mirror: make it more understandable when adding peer returns error
Signed-off-by: songweibin <song.weibin@zte.com.cn>
@Songweibin

This comment has been minimized.

Contributor

Songweibin commented Jul 18, 2017

@dillaman done. thanks for your review.

@dillaman

lgtm

@dillaman dillaman merged commit ee958a5 into ceph:master Jul 21, 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

@Songweibin Songweibin deleted the Songweibin:wip-mirror-peer branch Jul 21, 2017

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