Do not print "PG disappeared after reload" verbose log messages when *it* was not present

This commit is contained in:
Vitaliy Filippov
2024-08-04 01:42:05 +03:00
parent e2ca3ad99e
commit eb3e8b8c19
+2 -2
View File
@@ -730,7 +730,7 @@ void etcd_state_client_t::clean_nonexistent_pgs()
{ {
if (!pg_cfg.state_exists) if (!pg_cfg.state_exists)
{ {
if (this->log_level > 3) if (this->log_level > 3 && (pg_cfg.cur_primary || pg_cfg.cur_state))
{ {
fprintf(stderr, "PG %u/%u primary OSD disappeared after reload, forgetting it\n", pool_item.first, pg_it->first); fprintf(stderr, "PG %u/%u primary OSD disappeared after reload, forgetting it\n", pool_item.first, pg_it->first);
} }
@@ -740,7 +740,7 @@ void etcd_state_client_t::clean_nonexistent_pgs()
} }
if (!pg_cfg.history_exists) if (!pg_cfg.history_exists)
{ {
if (this->log_level > 3) if (this->log_level > 3 && (pg_cfg.target_history.size() || pg_cfg.all_peers.size() || pg_cfg.epoch || pg_cfg.next_scrub))
{ {
fprintf(stderr, "PG %u/%u history disappeared after reload, forgetting it\n", pool_item.first, pg_it->first); fprintf(stderr, "PG %u/%u history disappeared after reload, forgetting it\n", pool_item.first, pg_it->first);
} }