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

Init crush_location in Objecter from config file. #6243

Merged
merged 1 commit into from Oct 24, 2015
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: 0 additions & 2 deletions src/librados/RadosClient.cc
Expand Up @@ -266,8 +266,6 @@ int librados::RadosClient::connect()

lock.Unlock();

cct->_conf->call_all_observers();

ldout(cct, 1) << "init done" << dendl;
err = 0;

Expand Down
21 changes: 13 additions & 8 deletions src/osdc/Objecter.cc
Expand Up @@ -163,17 +163,21 @@ void Objecter::handle_conf_change(const struct md_config_t *conf,
const std::set <std::string> &changed)
{
if (changed.count("crush_location")) {
crush_location.clear();
vector<string> lvec;
get_str_vec(cct->_conf->crush_location, ";, \t", lvec);
int r = CrushWrapper::parse_loc_multimap(lvec, &crush_location);
if (r < 0) {
lderr(cct) << "warning: crush_location '" << cct->_conf->crush_location
<< "' does not parse" << dendl;
}
update_crush_location();
}
}

void Objecter::update_crush_location()
{
crush_location.clear();
vector<string> lvec;
get_str_vec(cct->_conf->crush_location, ";, \t", lvec);
int r = CrushWrapper::parse_loc_multimap(lvec, &crush_location);
if (r < 0) {
lderr(cct) << "warning: crush_location '" << cct->_conf->crush_location
<< "' does not parse" << dendl;
}
}

// messages ------------------------------

Expand Down Expand Up @@ -288,6 +292,7 @@ void Objecter::init()
timer.init();
timer_lock.Unlock();

update_crush_location();
cct->_conf->add_observer(this);

initialized.set(1);
Expand Down
1 change: 1 addition & 0 deletions src/osdc/Objecter.h
Expand Up @@ -1112,6 +1112,7 @@ class Objecter : public md_config_obs_t, public Dispatcher {

void schedule_tick();
void tick();
void update_crush_location();

class RequestStateHook : public AdminSocketHook {
Objecter *m_objecter;
Expand Down