Browse Source

Correct fix for "Pool %u PG %u configuration is invalid" during startup

Establish watcher connection after loading PGs
tags/v0.5.1
Vitaliy Filippov 2 months ago
parent
commit
9abf3c17c9
3 changed files with 6 additions and 7 deletions
  1. +0
    -1
      cluster_client.cpp
  2. +5
    -4
      etcd_state_client.cpp
  3. +1
    -2
      osd_cluster.cpp

+ 0
- 1
cluster_client.cpp View File

@@ -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();
}



+ 5
- 4
etcd_state_client.cpp View File

@@ -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();
});
}



+ 1
- 2
osd_cluster.cpp View File

@@ -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();
}



Loading…
Cancel
Save