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

osd/OSDMonitor: misc. fixes #10491

Merged
merged 3 commits into from Aug 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions qa/workunits/cephtool/test.sh
Expand Up @@ -1109,6 +1109,8 @@ function test_mon_osd()
expect_false ceph osd unset bogus
ceph osd set require_jewel_osds
expect_false ceph osd unset require_jewel_osds
ceph osd set require_kraken_osds
expect_false ceph osd unset require_kraken_osds

ceph osd set noup
ceph osd down 0
Expand Down
2 changes: 1 addition & 1 deletion src/mon/MonCommands.h
Expand Up @@ -628,7 +628,7 @@ COMMAND("osd erasure-code-profile ls", \
"list all erasure code profiles", \
"osd", "r", "cli,rest")
COMMAND("osd set " \
"name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise|require_jewel_osds", \
"name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise|require_jewel_osds|require_kraken_osds", \
Copy link
Contributor

Choose a reason for hiding this comment

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

probably you can reference this line: https://github.com/ceph/ceph/blob/9bef6cf/src/mon/OSDMonitor.cc#L6355, in the commit message.

i am not able to identify the piece of code referenced by #9248 (comment) anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I am trying to add a reference for why this change is necessary.
Will remove that later.

"set <key>", "osd", "rw", "cli,rest")
COMMAND("osd unset " \
"name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise", \
Expand Down
12 changes: 9 additions & 3 deletions src/mon/OSDMonitor.cc
Expand Up @@ -1978,7 +1978,7 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op)
}

if (osdmap.test_flag(CEPH_OSDMAP_REQUIRE_JEWEL) &&
!(m->get_connection()->get_features() & CEPH_FEATURE_SERVER_JEWEL)) {
!(m->osd_features & CEPH_FEATURE_SERVER_JEWEL)) {
mon->clog->info() << "disallowing boot of OSD "
<< m->get_orig_source_inst()
<< " because the osdmap requires"
Expand Down Expand Up @@ -6649,8 +6649,14 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
"--yes-i-really-mean-it if you really do.";
err = -EPERM;
goto reply;
} else if (!osdmap.exists(id) || !osdmap.is_down(id)) {
ss << "osd." << id << " is not down or doesn't exist";
} else if (!osdmap.exists(id)) {
ss << "osd." << id << " does not exist";
err = -ENOENT;
goto reply;
} else if (!osdmap.is_down(id)) {
ss << "osd." << id << " is not down";
err = -EBUSY;
goto reply;
} else {
epoch_t e = osdmap.get_info(id).down_at;
pending_inc.new_lost[id] = e;
Expand Down
2 changes: 2 additions & 0 deletions src/osd/OSDMap.cc
Expand Up @@ -2382,6 +2382,8 @@ string OSDMap::get_flag_string(unsigned f)
s += ",sortbitwise";
if (f & CEPH_OSDMAP_REQUIRE_JEWEL)
s += ",require_jewel_osds";
if (f & CEPH_OSDMAP_REQUIRE_KRAKEN)
s += ",require_kraken_osds";
if (s.length())
s.erase(0, 1);
return s;
Expand Down