Make OSDs stick to the last successful etcd address

Previously OSDs were selecting a new random etcd from the cluster
on every request so they were failing randomly when part of etcds was down
This commit is contained in:
Vitaliy Filippov
2021-11-27 23:48:56 +03:00
parent 8398ad0117
commit ce5b6253ab
3 changed files with 63 additions and 20 deletions
+2 -2
View File
@@ -15,7 +15,7 @@
// Peer connection is lost -> Reload connection data -> Try to reconnect
void osd_t::init_cluster()
{
if (!st_cli.etcd_addresses.size())
if (!st_cli.address_count())
{
if (run_primary)
{
@@ -711,7 +711,7 @@ struct reporting_pg_t
void osd_t::report_pg_states()
{
if (etcd_reporting_pg_state || !this->pg_state_dirty.size() || !st_cli.etcd_addresses.size())
if (etcd_reporting_pg_state || !this->pg_state_dirty.size() || !st_cli.address_count())
{
return;
}