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: add 'osd crush set-all-straw-buckets-to-straw2' #18460

Merged
merged 2 commits into from Oct 24, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Copy link
Member

commented Oct 21, 2017

No description provided.

crush/CrushWrapper: add bucket_set_alg()
Signed-off-by: Sage Weil <sage@redhat.com>

@tchaikov tchaikov self-requested a review Oct 21, 2017

for (int b = 0; b < newcrush.get_max_buckets(); ++b) {
int bid = -1 - b;
if (newcrush.bucket_exists(bid) &&
newcrush.get_bucket_alg(bid)) {

This comment has been minimized.

Copy link
@tchaikov

tchaikov Oct 23, 2017

Contributor

shall we check if the returned alg is CRUSH_BUCKET_STRAW ? and if it's not or is already CRUSH_BUCKET_STRAW2, we might want to ignore it. and only wait_for_finished_proposal() if we changed the alg of any bucket.

This comment has been minimized.

Copy link
@liewegas

liewegas Oct 23, 2017

Author Member

fixed the check.

Making a no-op path is a lot of work because the get_pending_crush thing may return an unstable crush map, and you still have to wait if it isn't the committed one. That means also having a flag for whether it is the stable or pending one or not (which we don't have currently) or repeating all the checks on osdmap.crush.

mon/OSDMonitor: add 'osd crush set-all-straw-buckets-to-straw2'
This is a common and recommended step that users should take once they
have clients that support straw2 (hammer!).  Let's make it easy.

This may result in a small amount of data movement, but usually it is
very little.

Signed-off-by: Sage Weil <sage@redhat.com>

@liewegas liewegas force-pushed the liewegas:wip-straw2-command branch from 9287705 to 4dcef73 Oct 23, 2017

} else if (prefix == "osd crush set-all-straw-buckets-to-straw2") {
CrushWrapper newcrush;
_get_pending_crush(newcrush);
for (int b = 0; b < newcrush.get_max_buckets(); ++b) {

This comment has been minimized.

Copy link
@tchaikov

tchaikov Oct 23, 2017

Contributor

@liewegas what i mean is something like this:

unsigned converted = 0;
for (...) {
  if (...) {
    // ...
    newcrush.bucket_set_alg(bid, CRUSH_BUCKET_STRAW2);
    converted++;
  }
}
if (!converted) {
  err = 0;
  ss << "no rules converted";
  goto reply;
}

This comment has been minimized.

Copy link
@liewegas

liewegas Oct 23, 2017

Author Member

Yeah, but we might not be converting anything because the unstable in-flight crush map doesn't need a change because we are racing with someone else making the same update. In that case we still have to wait for paxos to commit.

This comment has been minimized.

Copy link
@tchaikov

tchaikov Oct 24, 2017

Contributor

oic! because the in-flight change could also contain the expected change of this command. so to be on the safe side, we need to wait.

thanks for your patience!

} else if (prefix == "osd crush set-all-straw-buckets-to-straw2") {
CrushWrapper newcrush;
_get_pending_crush(newcrush);
for (int b = 0; b < newcrush.get_max_buckets(); ++b) {

This comment has been minimized.

Copy link
@tchaikov

tchaikov Oct 24, 2017

Contributor

oic! because the in-flight change could also contain the expected change of this command. so to be on the safe side, we need to wait.

thanks for your patience!

@tchaikov tchaikov merged commit bc139f0 into ceph:master Oct 24, 2017

5 checks passed

Docs: build check OK - docs built
Details
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

@tchaikov tchaikov removed the needs-review label Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.