Correct fix for "Pool %u PG %u configuration is invalid" during startup
Establish watcher connection after loading PGs
父節點
d2b901aa09
當前提交
9abf3c17c9
|
@ -195,7 +195,6 @@ void cluster_client_t::on_load_config_hook(json11::Json::object & config)
|
|||
{
|
||||
msgr.peer_connect_timeout = DEFAULT_PEER_CONNECT_TIMEOUT;
|
||||
}
|
||||
st_cli.start_etcd_watcher();
|
||||
st_cli.load_pgs();
|
||||
}
|
||||
|
||||
|
|
|
@ -216,10 +216,6 @@ void etcd_state_client_t::load_global_config()
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (!etcd_watch_revision)
|
||||
{
|
||||
etcd_watch_revision = data["header"]["revision"].uint64_value();
|
||||
}
|
||||
json11::Json::object global_config;
|
||||
if (data["kvs"].array_items().size() > 0)
|
||||
{
|
||||
|
@ -292,6 +288,10 @@ void etcd_state_client_t::load_pgs()
|
|||
on_load_pgs_hook(false);
|
||||
return;
|
||||
}
|
||||
if (!etcd_watch_revision)
|
||||
{
|
||||
etcd_watch_revision = data["header"]["revision"].uint64_value();
|
||||
}
|
||||
for (auto & res: data["responses"].array_items())
|
||||
{
|
||||
for (auto & kv_json: res["response_range"]["kvs"].array_items())
|
||||
|
@ -301,6 +301,7 @@ void etcd_state_client_t::load_pgs()
|
|||
}
|
||||
}
|
||||
on_load_pgs_hook(true);
|
||||
start_etcd_watcher();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ void osd_t::on_change_osd_state_hook(osd_num_t peer_osd)
|
|||
void osd_t::on_change_etcd_state_hook(json11::Json::object & changes)
|
||||
{
|
||||
// FIXME apply config changes in runtime (maybe, some)
|
||||
if (run_primary && !(peering_state & OSD_LOADING_PGS))
|
||||
if (run_primary)
|
||||
{
|
||||
apply_pg_count();
|
||||
apply_pg_config();
|
||||
|
@ -273,7 +273,6 @@ void osd_t::on_load_config_hook(json11::Json::object & global_config)
|
|||
}
|
||||
parse_config(osd_config);
|
||||
bind_socket();
|
||||
st_cli.start_etcd_watcher();
|
||||
acquire_lease();
|
||||
}
|
||||
|
||||
|
|
載入中…
新增問題並參考