Skip to content

Commit

Permalink
Merge pull request #17322 from liewegas/wip-post-luminous-mon
Browse files Browse the repository at this point in the history
mon: remove pre-luminous compat cruft (2 of many)

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
  • Loading branch information
liewegas committed Sep 7, 2017
2 parents f9777fa + e715533 commit 1006b62
Show file tree
Hide file tree
Showing 53 changed files with 243 additions and 5,100 deletions.
2 changes: 1 addition & 1 deletion ceph-object-corpus
21 changes: 1 addition & 20 deletions doc/man/8/ceph.rst
Expand Up @@ -47,7 +47,7 @@ Synopsis
| **ceph** **osd** **tier** [ *add* \| *add-cache* \| *cache-mode* \| *remove* \| *remove-overlay* \| *set-overlay* ] ...
| **ceph** **pg** [ *debug* \| *deep-scrub* \| *dump* \| *dump_json* \| *dump_pools_json* \| *dump_stuck* \| *force_create_pg* \| *getmap* \| *ls* \| *ls-by-osd* \| *ls-by-pool* \| *ls-by-primary* \| *map* \| *repair* \| *scrub* \| *set_full_ratio* \| *set_nearfull_ratio* \| *stat* ] ...
| **ceph** **pg** [ *debug* \| *deep-scrub* \| *dump* \| *dump_json* \| *dump_pools_json* \| *dump_stuck* \| *getmap* \| *ls* \| *ls-by-osd* \| *ls-by-pool* \| *ls-by-primary* \| *map* \| *repair* \| *scrub* \| *stat* ] ...
| **ceph** **quorum** [ *enter* \| *exit* ]
Expand Down Expand Up @@ -1324,25 +1324,6 @@ Usage::

ceph pg scrub <pgid>

Subcommand ``set_full_ratio`` sets ratio at which pgs are considered full.

Usage::

ceph pg set_full_ratio <float[0.0-1.0]>

Subcommand ``set_backfillfull_ratio`` sets ratio at which pgs are considered too full to backfill.

Usage::

ceph pg set_backfillfull_ratio <float[0.0-1.0]>

Subcommand ``set_nearfull_ratio`` sets ratio at which pgs are considered nearly
full.

Usage::

ceph pg set_nearfull_ratio <float[0.0-1.0]>

Subcommand ``stat`` shows placement group status.

Usage::
Expand Down
20 changes: 14 additions & 6 deletions qa/standalone/mon/misc.sh
Expand Up @@ -164,7 +164,7 @@ function TEST_mon_features() {
CEPH_ARGS+="--mon-initial-members=a,b,c "
CEPH_ARGS+="--mon-host=$MONA,$MONB,$MONC "
CEPH_ARGS+="--mon-debug-no-initial-persistent-features "
CEPH_ARGS+="--mon-debug-no-require-luminous "
CEPH_ARGS+="--mon-debug-no-require-mimic "

run_mon $dir a --public-addr $MONA || return 1
run_mon $dir b --public-addr $MONB || return 1
Expand All @@ -175,11 +175,13 @@ function TEST_mon_features() {
jq_success "$jqinput" '.monmap.mons | length == 3' || return 1
# quorum contains two monitors
jq_success "$jqinput" '.quorum | length == 2' || return 1
# quorum's monitor features contain kraken and luminous
# quorum's monitor features contain kraken, luminous, and mimic
jqfilter='.features.quorum_mon[]|select(. == "kraken")'
jq_success "$jqinput" "$jqfilter" "kraken" || return 1
jqfilter='.features.quorum_mon[]|select(. == "luminous")'
jq_success "$jqinput" "$jqfilter" "luminous" || return 1
jqfilter='.features.quorum_mon[]|select(. == "mimic")'
jq_success "$jqinput" "$jqfilter" "mimic" || return 1

# monmap must have no persistent features set, because we
# don't currently have a quorum made out of all the monitors
Expand All @@ -194,11 +196,13 @@ function TEST_mon_features() {
# validate 'mon feature ls'

jqinput="$(ceph mon feature ls --format=json 2>/dev/null)"
# 'kraken' and 'luminous' are supported
# k l m are supported
jqfilter='.all.supported[] | select(. == "kraken")'
jq_success "$jqinput" "$jqfilter" "kraken" || return 1
jqfilter='.all.supported[] | select(. == "luminous")'
jq_success "$jqinput" "$jqfilter" "luminous" || return 1
jqfilter='.all.supported[] | select(. == "mimic")'
jq_success "$jqinput" "$jqfilter" "mimic" || return 1

# start third monitor
run_mon $dir c --public-addr $MONC || return 1
Expand All @@ -211,20 +215,24 @@ function TEST_mon_features() {
# expect quorum to have all three monitors
jqfilter='.quorum | length == 3'
jq_success "$jqinput" "$jqfilter" || return 1
# quorum's monitor features contain kraken and luminous
# quorum's monitor features contain k and l and m
jqfilter='.features.quorum_mon[]|select(. == "kraken")'
jq_success "$jqinput" "$jqfilter" "kraken" || return 1
jqfilter='.features.quorum_mon[]|select(. == "luminous")'
jq_success "$jqinput" "$jqfilter" "luminous" || return 1
jqfilter='.features.quorum_mon[]|select(. == "mimic")'
jq_success "$jqinput" "$jqfilter" "mimic" || return 1

# monmap must have no both 'kraken' and 'luminous' persistent
# monmap must have not all k l m persistent
# features set.
jqfilter='.monmap.features.persistent | length == 2'
jqfilter='.monmap.features.persistent | length == 3'
jq_success "$jqinput" "$jqfilter" || return 1
jqfilter='.monmap.features.persistent[]|select(. == "kraken")'
jq_success "$jqinput" "$jqfilter" "kraken" || return 1
jqfilter='.monmap.features.persistent[]|select(. == "luminous")'
jq_success "$jqinput" "$jqfilter" "luminous" || return 1
jqfilter='.monmap.features.persistent[]|select(. == "mimic")'
jq_success "$jqinput" "$jqfilter" "mimic" || return 1

CEPH_ARGS=$CEPH_ARGS_orig
# that's all folks. thank you for tuning in.
Expand Down
5 changes: 1 addition & 4 deletions qa/workunits/cephtool/test.sh
Expand Up @@ -1436,7 +1436,7 @@ function test_mon_osd()
expect_false ceph osd unset sortbitwise # cannot be unset
expect_false ceph osd set bogus
expect_false ceph osd unset bogus
ceph osd require-osd-release luminous
ceph osd require-osd-release mimic
# can't lower (or use new command for anything but jewel)
expect_false ceph osd require-osd-release jewel
# these are no-ops but should succeed.
Expand Down Expand Up @@ -2178,9 +2178,6 @@ function test_mon_osd_misc()
# expect error about unused argument foo
ceph osd ls foo 2>$TMPFILE; check_response 'unused' $? 22

# expect "not in range" for invalid full ratio
ceph pg set_full_ratio 95 2>$TMPFILE; check_response 'not in range' $? 22

# expect "not in range" for invalid overload percentage
ceph osd reweight-by-utilization 80 2>$TMPFILE; check_response 'higher than 100' $? 22

Expand Down
2 changes: 1 addition & 1 deletion qa/workunits/mon/crush_ops.sh
Expand Up @@ -20,7 +20,7 @@ ceph osd crush rule create-simple foo default host
ceph osd crush rule create-simple bar default host

# make sure we're at luminous+ before using crush device classes
ceph osd require-osd-release luminous
ceph osd require-osd-release mimic
ceph osd crush rm-device-class all
ceph osd crush set-device-class ssd osd.0
ceph osd crush set-device-class hdd osd.1
Expand Down
7 changes: 2 additions & 5 deletions src/ceph_mon.cc
Expand Up @@ -679,13 +679,10 @@ int main(int argc, const char **argv)
msgr->set_default_policy(Messenger::Policy::stateless_server(0));
msgr->set_policy(entity_name_t::TYPE_MON,
Messenger::Policy::lossless_peer_reuse(
CEPH_FEATURE_UID |
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_MON_SINGLE_PAXOS));
CEPH_FEATURE_SERVER_LUMINOUS));
msgr->set_policy(entity_name_t::TYPE_OSD,
Messenger::Policy::stateless_server(
CEPH_FEATURE_PGID64 |
CEPH_FEATURE_OSDENC));
CEPH_FEATURE_SERVER_LUMINOUS));
msgr->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateless_server(0));
msgr->set_policy(entity_name_t::TYPE_MDS,
Expand Down
4 changes: 1 addition & 3 deletions src/common/legacy_config_opts.h
Expand Up @@ -223,8 +223,6 @@ OPTION(mon_osd_min_in_ratio, OPT_DOUBLE) // min osds required to be in to mark
OPTION(mon_osd_warn_op_age, OPT_DOUBLE) // max op age before we generate a warning (make it a power of 2)
OPTION(mon_osd_err_op_age_ratio, OPT_DOUBLE) // when to generate an error, as multiple of mon_osd_warn_op_age
OPTION(mon_osd_max_split_count, OPT_INT) // largest number of PGs per "involved" OSD to let split create
OPTION(mon_osd_allow_primary_temp, OPT_BOOL) // allow primary_temp to be set in the osdmap
OPTION(mon_osd_allow_primary_affinity, OPT_BOOL) // allow primary_affinity to be set in the osdmap
OPTION(mon_osd_prime_pg_temp, OPT_BOOL) // prime osdmap with pg mapping changes
OPTION(mon_osd_prime_pg_temp_max_time, OPT_FLOAT) // max time to spend priming
OPTION(mon_osd_prime_pg_temp_max_estimate, OPT_FLOAT) // max estimate of pg total before we do all pgs in parallel
Expand Down Expand Up @@ -312,7 +310,7 @@ OPTION(mon_debug_deprecated_as_obsolete, OPT_BOOL) // consider deprecated comman
OPTION(mon_debug_dump_transactions, OPT_BOOL)
OPTION(mon_debug_dump_json, OPT_BOOL)
OPTION(mon_debug_dump_location, OPT_STR)
OPTION(mon_debug_no_require_luminous, OPT_BOOL)
OPTION(mon_debug_no_require_mimic, OPT_BOOL)
OPTION(mon_debug_no_require_bluestore_for_ec_overwrites, OPT_BOOL)
OPTION(mon_debug_no_initial_persistent_features, OPT_BOOL)
OPTION(mon_inject_transaction_delay_max, OPT_DOUBLE) // seconds
Expand Down
10 changes: 1 addition & 9 deletions src/common/options.cc
Expand Up @@ -961,14 +961,6 @@ std::vector<Option> get_global_options() {
.set_default(32)
.set_description(""),

Option("mon_osd_allow_primary_temp", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(false)
.set_description(""),

Option("mon_osd_allow_primary_affinity", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(false)
.set_description(""),

Option("mon_osd_prime_pg_temp", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description(""),
Expand Down Expand Up @@ -1311,7 +1303,7 @@ std::vector<Option> get_global_options() {
.set_default("/var/log/ceph/$cluster-$name.tdump")
.set_description(""),

Option("mon_debug_no_require_luminous", Option::TYPE_BOOL, Option::LEVEL_DEV)
Option("mon_debug_no_require_mimic", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.set_description(""),

Expand Down
85 changes: 0 additions & 85 deletions src/messages/MMonHealth.h

This file was deleted.

5 changes: 2 additions & 3 deletions src/mgr/ClusterState.cc
Expand Up @@ -29,8 +29,7 @@ ClusterState::ClusterState(
: monc(monc_),
objecter(objecter_),
lock("ClusterState"),
mgr_map(mgrmap),
pgservice(pg_map)
mgr_map(mgrmap)
{}

void ClusterState::set_objecter(Objecter *objecter_)
Expand Down Expand Up @@ -71,7 +70,7 @@ void ClusterState::ingest_pgstats(MPGStats *stats)

const int from = stats->get_orig_source().num();

pending_inc.update_stat(from, stats->epoch, std::move(stats->osd_stat));
pending_inc.update_stat(from, std::move(stats->osd_stat));

for (auto p : stats->pg_stat) {
pg_t pgid = p.first;
Expand Down
10 changes: 0 additions & 10 deletions src/mgr/ClusterState.h
Expand Up @@ -47,8 +47,6 @@ class ClusterState
PGMap pg_map;
PGMap::Incremental pending_inc;

PGMapStatService pgservice;

bufferlist health_json;
bufferlist mon_status_json;

Expand Down Expand Up @@ -105,14 +103,6 @@ class ClusterState
return std::forward<Callback>(cb)(pg_map, std::forward<Args>(args)...);
}

template<typename Callback, typename...Args>
auto with_pgservice(Callback&& cb, Args&&...args) const ->
decltype(cb(pgservice, std::forward<Args>(args)...))
{
Mutex::Locker l(lock);
return std::forward<Callback>(cb)(pg_map, std::forward<Args>(args)...);
}

template<typename... Args>
void with_monmap(Args &&... args) const
{
Expand Down
4 changes: 2 additions & 2 deletions src/mgr/DaemonServer.cc
Expand Up @@ -914,9 +914,9 @@ bool DaemonServer::handle_command(MCommand *m)
} else if (prefix == "osd df") {
string method;
cmd_getval(g_ceph_context, cmdctx->cmdmap, "output_method", method);
r = cluster_state.with_pgservice([&](const PGMapStatService& pgservice) {
r = cluster_state.with_pgmap([&](const PGMap& pgmap) {
return cluster_state.with_osdmap([&](const OSDMap& osdmap) {
print_osd_utilization(osdmap, &pgservice, ss,
print_osd_utilization(osdmap, pgmap, ss,
f.get(), method == "tree");

cmdctx->odata.append(ss);
Expand Down
3 changes: 0 additions & 3 deletions src/mon/CMakeLists.txt
Expand Up @@ -16,9 +16,6 @@ set(lib_mon_srcs
AuthMonitor.cc
Elector.cc
HealthMonitor.cc
OldHealthMonitor.cc
DataHealthService.cc
PGMonitor.cc
PGMap.cc
ConfigKeyService.cc
../mgr/mgr_commands.cc)
Expand Down
2 changes: 0 additions & 2 deletions src/mon/ConfigKeyService.h
Expand Up @@ -57,8 +57,6 @@ class ConfigKeyService : public QuorumService
* @{
*/
void init() override { }
void get_health(list<pair<health_status_t,string> >& summary,
list<pair<health_status_t,string> > *detail) override { }
bool service_dispatch(MonOpRequestRef op) override;

void start_epoch() override { }
Expand Down

0 comments on commit 1006b62

Please sign in to comment.