1
0
Fork 0

Compare commits

...

1 Commits

Author SHA1 Message Date
Vitaliy Filippov 0f964d62db Add debug 2023-01-06 12:46:44 +03:00
2 changed files with 16 additions and 0 deletions

View File

@ -867,6 +867,7 @@ void etcd_state_client_t::parse_state(const etcd_kv_t & kv)
} }
else else
{ {
fprintf(stderr, "RECEIVED PG %u/%u HISTORY: %s\n", pool_id, pg_num, value.dump().c_str());
auto & pg_cfg = this->pool_config[pool_id].pg_config[pg_num]; auto & pg_cfg = this->pool_config[pool_id].pg_config[pg_num];
pg_cfg.target_history.clear(); pg_cfg.target_history.clear();
pg_cfg.all_peers.clear(); pg_cfg.all_peers.clear();

View File

@ -694,6 +694,20 @@ void osd_t::apply_pg_config()
} }
else else
{ {
printf(
"Repeer %u/%u because of history: %s vs %s\n",
pool_id, pg_num,
json11::Json(json11::Json::object {
{ "target_set", pg_cfg.target_set },
{ "osd_sets", pg_cfg.target_history },
{ "all_peers", vec_all_peers },
}).dump().c_str(),
json11::Json(json11::Json::object {
{ "target_set", pg_it->second.target_set },
{ "osd_sets", pg_it->second.target_history },
{ "all_peers", pg_it->second.all_peers },
}).dump().c_str()
);
// Stop PG, reapply change after stopping // Stop PG, reapply change after stopping
stop_pg(pg_it->second); stop_pg(pg_it->second);
all_applied = false; all_applied = false;
@ -871,6 +885,7 @@ void osd_t::report_pg_states()
{ "all_peers", pg.all_peers }, { "all_peers", pg.all_peers },
{ "osd_sets", pg.target_history }, { "osd_sets", pg.target_history },
}; };
printf("PG %u/%u HISTORY -> %s\n", pg.pool_id, pg.pg_num, json11::Json(history_value).dump().c_str());
checks.push_back(json11::Json::object { checks.push_back(json11::Json::object {
{ "target", "MOD" }, { "target", "MOD" },
{ "key", history_key }, { "key", history_key },