From 322a38a1443ef794b222aaa52334f68d00fe01fc Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 4 Dec 2020 23:46:48 +0300 Subject: [PATCH] Fix non-preserved real_pg_count leading to inability to change pools online --- etcd_state_client.cpp | 1 + osd_cluster.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/etcd_state_client.cpp b/etcd_state_client.cpp index e4528bd0..7d2240c9 100644 --- a/etcd_state_client.cpp +++ b/etcd_state_client.cpp @@ -407,6 +407,7 @@ void etcd_state_client_t::parse_state(const std::string & key, const json11::Jso if (pc.pg_stripe_size < min_stripe_size) pc.pg_stripe_size = min_stripe_size; // Save + pc.real_pg_count = this->pool_config[pool_id].real_pg_count; std::swap(pc.pg_config, this->pool_config[pool_id].pg_config); std::swap(this->pool_config[pool_id], pc); auto & parsed_cfg = this->pool_config[pool_id]; diff --git a/osd_cluster.cpp b/osd_cluster.cpp index dd7164a0..37574499 100644 --- a/osd_cluster.cpp +++ b/osd_cluster.cpp @@ -494,7 +494,11 @@ void osd_t::apply_pg_count() } if (still_active > 0) { - printf("[OSD %lu] PG count change detected, but %d PG(s) are still active. This is not allowed. Exiting\n", this->osd_num, still_active); + printf( + "[OSD %lu] PG count change detected for pool %u (new is %lu, old is %u)," + " but %u PG(s) are still active. This is not allowed. Exiting\n", + this->osd_num, pool_item.first, pool_item.second.real_pg_count, pg_counts[pool_item.first], still_active + ); force_stop(1); return; }