oss << "peering+";
if (state & PG_STATE_REPAIR)
oss << "repair+";
- if ((state & PG_STATE_BACKFILL_WAIT) &&
- !(state &PG_STATE_BACKFILL))
+ if (state & PG_STATE_BACKFILL_WAIT)
oss << "backfill_wait+";
- if (state & PG_STATE_BACKFILL)
+ if (state & PG_STATE_BACKFILLING)
oss << "backfilling+";
if (state & PG_STATE_FORCED_BACKFILL)
oss << "forced_backfill+";
return ret;
}
-int pg_string_state(const std::string& state)
+boost::optional<uint64_t> pg_string_state(const std::string& state)
{
- int type;
+ boost::optional<uint64_t> type;
if (state == "active")
type = PG_STATE_ACTIVE;
else if (state == "clean")
type = PG_STATE_REMAPPED;
else if (state == "deep_scrub")
type = PG_STATE_DEEP_SCRUB;
- else if (state == "backfill")
- type = PG_STATE_BACKFILL;
+ else if (state == "backfilling")
+ type = PG_STATE_BACKFILLING;
else if (state == "forced_backfill")
type = PG_STATE_FORCED_BACKFILL;
else if (state == "backfill_toofull")
else if (state == "snaptrim_error")
type = PG_STATE_SNAPTRIM_ERROR;
else
- type = -1;
+ type = boost::none;
return type;
}