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,crush: add 'osd crush swap-bucket' command #15072

Merged
merged 4 commits into from May 16, 2017

Conversation

Projects
None yet
3 participants
@liewegas
Member

liewegas commented May 12, 2017

This is a generally useful command but is specifically intended to be used
when migrating an entire host at a time from filestore to bluestore.

@liewegas liewegas requested review from and tchaikov May 12, 2017

@ghost

It's also worth adding a tests in to verify --yes-i-really-mean-it works as intended in a file like src/test/crush/crush-swap.sh similar to src/test/crush/crush-classes.sh

}
int sid = newcrush.get_item_id(source);
int did = newcrush.get_item_id(dest);
int sparent;

This comment has been minimized.

@ghost

ghost May 13, 2017

It is worth checking the alg of both buckets is the same as well.

@ghost ghost added the feature label May 13, 2017

@tchaikov

lgtm, modulo the nits.

int item = a->items[0];
int itemw = crush_get_bucket_item_weight(a, 0);
tmp[item] = itemw;
lderr(cct) << " rm a item " << item << " weight " << std::hex << itemw << dendl;

This comment has been minimized.

@tchaikov

tchaikov May 15, 2017

Contributor

maybe we should use ldout(cct, 0) instead of lderr(cct)? the latter is for error anyway.

This comment has been minimized.

@liewegas

liewegas May 15, 2017

Member

oops, that wasn't supposed to be included in the commit :)

goto reply;
}
ss << "swapped bucket of " << source << " to " << dest;
pending_inc.crush.clear();

This comment has been minimized.

@tchaikov

tchaikov May 15, 2017

Contributor

shall we at least print a message in lderr(cct) if _have_pending_crush() before nuking it?

This comment has been minimized.

@liewegas

liewegas May 15, 2017

Member

this is normal; the _get_pending_crush decodes the latest (possibly pending) map, and here we (re)encode the new pending map.

@ghost

ghost approved these changes May 15, 2017

liewegas added some commits May 12, 2017

crush: implement swap_bucket
Swap contents between buckets.

Signed-off-by: Sage Weil <sage@redhat.com>
mon/OSDMonitor: add 'osd crush swap-bucket' command
Swap contents of two crush buckets.  Do it safely by default so that
the origin bucket has to be an orphan (unless forced).

Signed-off-by: Sage Weil <sage@redhat.com>
crush: add crush_alg_name
Signed-off-by: Sage Weil <sage@redhat.com>
mon/OSDMonitor: require force flag is swap-bucket alg types differ
Signed-off-by: Sage Weil <sage@redhat.com>

@yuriw yuriw merged commit 07ac91d into ceph:master May 16, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment