Report PG history synchronously during write

This has 2 effects:
1) OSD sets aren't added into PG history until actual write attempts anymore
   which removes unneeded extra osd_sets in PG history
2) New OSD sets are reported synchronously and can't be lost on PG restarts
   happening at the same time with reconfiguration
This commit is contained in:
Vitaliy Filippov
2023-01-01 23:41:05 +03:00
parent 37a6aff2fa
commit a4dfa519af
3 changed files with 23 additions and 18 deletions
-1
View File
@@ -885,7 +885,6 @@ void osd_t::report_pg_states()
if (pg.history_changed)
{
// Prevent race conditions (for the case when the monitor is updating this key at the same time)
// FIXME: target_history updates may be lost on PG re-peering
pg.history_changed = false;
std::string history_key = base64_encode(st_cli.etcd_prefix+"/pg/history/"+std::to_string(pg.pool_id)+"/"+std::to_string(pg.pg_num));
json11::Json::object history_value = {