Skip to content
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

mon/OSDMonitor: make 'osd crush class rename' idempotent #17330

Merged
merged 1 commit into from Aug 29, 2017

Conversation

xiexingguo
Copy link
Member

Signed-off-by: xie xingguo xie.xingguo@zte.com.cn

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
goto reply;
}

if (newcrush.class_exists(dstname)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we keep this, so that if both src and dest exist, you still get EEXIST?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CrushWrapper::rename_class will do this:

int CrushWrapper::rename_class(const string& srcname, const string& dstname)
{
  auto i = class_rname.find(srcname);
  if (i == class_rname.end())
    return -ENOENT;
  auto j = class_rname.find(dstname);
  if (j != class_rname.end())
    return -EEXIST;

liewegas added a commit that referenced this pull request Aug 29, 2017
mon/OSDMonitor: make 'osd crush class rename' idempotent

Reviewed-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit af10bae into ceph:master Aug 29, 2017
@liewegas
Copy link
Member

#17344

@xiexingguo xiexingguo deleted the wip-class-rename-idempotent branch August 29, 2017 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants