readable.sh can fail decoding pre-v3 corpus objects that predate the
unit field, e.g.:
**** reencode of .../objects/PerfCounterType/... resulted in a different dump ****
7c7
< "unit": 36
---
> "unit": 101
For struct_v < 3 unit is never decoded and had no in-class default, so
it read indeterminate memory and differed between the two ceph-dencoder
processes readable.sh compares. Default it to UNIT_NONE.
Also default-initialize type to PERFCOUNTER_NONE for consistency.
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
std::string path;
std::string description;
std::string nick;
- enum perfcounter_type_d type;
+ enum perfcounter_type_d type = PERFCOUNTER_NONE;
// For older clients that did not send priority, pretend everything
// is "useful" so that mgr plugins filtering on prio will get some
// data (albeit probably more than they wanted)
uint8_t priority = PerfCountersBuilder::PRIO_USEFUL;
- enum unit_t unit;
+ enum unit_t unit = UNIT_NONE;
void encode(ceph::buffer::list &bl) const
{