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: Add ceph osd get-require-min-compat-client command #19015

Merged
merged 1 commit into from Feb 28, 2018

Conversation

hansbogert
Copy link
Contributor

@hansbogert hansbogert commented Nov 19, 2017

As an antagonist to the already existing set-require-min-compat-client

@hansbogert
Copy link
Contributor Author

I'm not sure if test code is needed for this, and if so, where I would have to add it.

@liewegas liewegas added the mon label Nov 19, 2017
@@ -8321,6 +8321,9 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
get_last_committed() + 1));
return true;
} else if (prefix == "osd get-require-min-compat-client") {
ss << "require_min_compat_client is set to " << ceph_release_name(osdmap.require_min_compat_client);
Copy link
Member

Choose a reason for hiding this comment

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

just ceph_release_name(..), no need to make it a complete sentence!

@liewegas
Copy link
Member

Can you add the test to .qa/workunits/cephtool/test.sh? Just call this after the set-... and grep for the result. Thanks!

@hansbogert
Copy link
Contributor Author

The errors in the ARM64 build seem unrelated. Is the ARM64 build still flaky?

Copy link

@amitkumar50 amitkumar50 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -704,6 +704,7 @@ COMMAND("osd set-nearfull-ratio " \
"name=ratio,type=CephFloat,range=0.0|1.0", \
"set usage ratio at which OSDs are marked near-full",
"osd", "rw", "cli,rest")
COMMAND("osd get-require-min-compat-client", "get the minimum client version we will maintain compatibility with", "osd", "r", "cli,rest")
Copy link
Member

Choose a reason for hiding this comment

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

I would appreciate if you could break this line to conform with the rest of the file, as well as the coding style guidelines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's the idea behind the continuation slashes? I can't seem to find consistency when I look at other COMMANDs.

@@ -8321,6 +8321,9 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
wait_for_finished_proposal(op, new Monitor::C_Command(mon, op, 0, rs,
get_last_committed() + 1));
return true;
} else if (prefix == "osd get-require-min-compat-client") {
Copy link
Member

Choose a reason for hiding this comment

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

This is a read-only command. It belongs in OSDMonitor::preprocess_command() instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well the responsibilities of the code in that file are a bit convoluted. (Functions with thousands of lines?!) so sorry, for not seeing that. But updated per your instructions.

@hansbogert
Copy link
Contributor Author

Does the "needs-test" label need to be removed before this will be picked up?

@yuriw
Copy link
Contributor

yuriw commented Jan 10, 2018

@@ -4791,6 +4791,9 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
rdata.append(ss.str());
ss.str("");
}
} else if (prefix == "osd get-require-min-compat-client") {
ss << ceph_release_name(osdmap.require_min_compat_client);
Copy link
Member

Choose a reason for hiding this comment

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

use rdata.append(...)
ss goes to stderr, rdata goes to stdout.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hansbogert untagged untill @Sage 's comments implemented

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liewegas then shouldn't the grep in the test have failed, as that grep only checks stdout ? is QA/integration test the only place to check this? Would've helped a lot if make check would've shown this error. Thank you for patience so far, for such a trivial patch.

Copy link
Member

Choose a reason for hiding this comment

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

currently, yes. we move a lot of the make check tests out to teuthology because they took too long to run. we might consider putting the cli tests back in!

As an antagonist to the already existing `set-require-min-compat-client`

Signed-off-by: hansbogert <hansbogert@gmail.com>
@hansbogert
Copy link
Contributor Author

@yuriw Can you or someone add the needs-review label?

@yuriw
Copy link
Contributor

yuriw commented Feb 21, 2018

@yuriw yuriw merged commit 57ffaaa into ceph:master Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants