Skip to content

Commit

Permalink
Merge pull request #11679 from dachary/wip-17734-jewel
Browse files Browse the repository at this point in the history
jewel: Upgrading 0.94.6 -> 0.94.9 saturating mon node networking

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
Loic Dachary committed Nov 7, 2016
2 parents eb67259 + eea546f commit 0c38c46
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions qa/workunits/cephtool/test.sh
Expand Up @@ -1081,6 +1081,8 @@ function test_mon_osd()
ceph osd set sortbitwise # new backends cant handle nibblewise
expect_false ceph osd set bogus
expect_false ceph osd unset bogus
ceph osd set require_jewel_osds
expect_false ceph osd unset require_jewel_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", \
"name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise|require_jewel_osds", \
"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
26 changes: 24 additions & 2 deletions src/mon/OSDMonitor.cc
Expand Up @@ -1203,13 +1203,24 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
}
}

// features for osdmap and its incremental
uint64_t features = mon->quorum_features;

// encode full map and determine its crc
OSDMap tmp;
{
tmp.deepish_copy_from(osdmap);
tmp.apply_incremental(pending_inc);

// determine appropriate features
if (!tmp.test_flag(CEPH_OSDMAP_REQUIRE_JEWEL)) {
dout(10) << __func__ << " encoding without feature SERVER_JEWEL" << dendl;
features &= ~CEPH_FEATURE_SERVER_JEWEL;
}
dout(10) << __func__ << " encoding full map with " << features << dendl;

bufferlist fullbl;
::encode(tmp, fullbl, mon->quorum_features | CEPH_FEATURE_RESERVED);
::encode(tmp, fullbl, features | CEPH_FEATURE_RESERVED);
pending_inc.full_crc = tmp.get_crc();

// include full map in the txn. note that old monitors will
Expand All @@ -1220,7 +1231,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)

// encode
assert(get_last_committed() + 1 == pending_inc.epoch);
::encode(pending_inc, bl, mon->quorum_features | CEPH_FEATURE_RESERVED);
::encode(pending_inc, bl, features | CEPH_FEATURE_RESERVED);

dout(20) << " full_crc " << tmp.get_crc()
<< " inc_crc " << pending_inc.inc_crc << dendl;
Expand Down Expand Up @@ -3048,6 +3059,17 @@ void OSDMonitor::get_health(list<pair<health_status_t,string> >& summary,
}
}

// warn about upgrade flags that can be set but are not.
if ((osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_JEWEL) &&
!osdmap.test_flag(CEPH_OSDMAP_REQUIRE_JEWEL)) {
string msg = "all OSDs are running jewel or later but the"
" 'require_jewel_osds' osdmap flag is not set";
summary.push_back(make_pair(HEALTH_WARN, msg));
if (detail) {
detail->push_back(make_pair(HEALTH_WARN, msg));
}
}

get_pools_health(summary, detail);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/osd/OSDMap.cc
Expand Up @@ -2385,6 +2385,8 @@ string OSDMap::get_flag_string(unsigned f)
s += ",notieragent";
if (f & CEPH_OSDMAP_SORTBITWISE)
s += ",sortbitwise";
if (f & CEPH_OSDMAP_REQUIRE_JEWEL)
s += ",require_jewel_osds";
if (s.length())
s.erase(0, 1);
return s;
Expand Down

0 comments on commit 0c38c46

Please sign in to comment.