Merge pull request #11386 from xiexingguo/xxg-wip-mgr-1008

mgr: misc minor changes

Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2016-10-19 15:16:22 +02:00 committed by GitHub
commit b1e652c7fd
4 changed files with 14 additions and 6 deletions

View File

@ -1515,6 +1515,7 @@ OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr") // where to load python
OPTION(mgr_modules, OPT_STR, "rest") // Which modules to load
OPTION(mgr_data, OPT_STR, "/var/lib/ceph/mgr/$cluster-$id") // where to find keyring etc
OPTION(mgr_beacon_period, OPT_INT, 5) // How frequently to send beacon
OPTION(mon_mgr_digest_period, OPT_INT, 5) // How frequently to send digests
OPTION(mon_mgr_beacon_grace, OPT_INT, 30) // How long to wait to failover
OPTION(rgw_list_bucket_min_readahead, OPT_INT, 1000) // minimum number of entries to read from rados for bucket listing

View File

@ -338,6 +338,7 @@ void Mgr::shutdown()
// Then stop the finisher to ensure its enqueued contexts aren't going
// to touch references to the things we're about to tear down
finisher.wait_for_empty();
finisher.stop();
}

View File

@ -73,8 +73,14 @@ int MgrStandby::init()
monc->set_want_keys(CEPH_ENTITY_TYPE_MON|CEPH_ENTITY_TYPE_OSD
|CEPH_ENTITY_TYPE_MDS|CEPH_ENTITY_TYPE_MGR);
monc->set_messenger(client_messenger);
monc->init();
int r = monc->authenticate();
int r = monc->init();
if (r < 0) {
monc->shutdown();
client_messenger->shutdown();
client_messenger->wait();
return r;
}
r = monc->authenticate();
if (r < 0) {
derr << "Authentication failed, did you specify a mgr ID with a valid keyring?" << dendl;
monc->shutdown();
@ -112,8 +118,7 @@ void MgrStandby::send_beacon()
available);
monc->send_mon_message(m);
// TODO configure period
timer.add_event_after(5, new C_StdFunction(
timer.add_event_after(g_conf->mgr_beacon_period, new C_StdFunction(
[this](){
send_beacon();
}

View File

@ -190,7 +190,7 @@ bool MgrMonitor::prepare_beacon(MonOpRequestRef op)
pending_map.active_name = m->get_name();
dout(4) << "selecting new active in epoch " << pending_map.epoch << dendl;
wait_for_finished_proposal(op, new C_Updated(this, op));
updated = true;
} else {
if (pending_map.standbys.count(m->get_gid()) > 0) {
dout(10) << "from existing standby " << m->get_gid() << dendl;
@ -271,7 +271,7 @@ void MgrMonitor::send_digests()
digest_callback = new C_StdFunction([this](){
send_digests();
});
mon->timer.add_event_after(5, digest_callback);
mon->timer.add_event_after(g_conf->mon_mgr_digest_period, digest_callback);
}
void MgrMonitor::tick()
@ -421,6 +421,7 @@ bool MgrMonitor::prepare_command(MonOpRequestRef op)
for (const auto &i : pending_map.standbys) {
if (i.second.name == who) {
gid = i.first;
break;
}
}
if (gid != 0) {