Signed-off-by: Orit Wasserman <owasserm@redhat.com>
{
RGWZone z;
z.decode_json(o);
- zones[z.name] = z;
+ zones[z.id] = z;
}
static void decode_placement_targets(map<string, RGWZoneGroupPlacementTarget>& targets, JSONObj *o)
WRITE_CLASS_ENCODER(RGWZoneParams)
struct RGWZone {
+ string id;
string name;
list<string> endpoints;
bool log_meta;
RGWZone() : log_meta(false), log_data(false), bucket_index_max_shards(0) {}
void encode(bufferlist& bl) const {
- ENCODE_START(3, 1, bl);
+ ENCODE_START(4, 1, bl);
+ ::encode(id, bl);
::encode(name, bl);
::encode(endpoints, bl);
::encode(log_meta, bl);
}
void decode(bufferlist::iterator& bl) {
- DECODE_START(2, bl);
+ DECODE_START(3, bl);
+ if (struct_v >= 4) {
+ ::decode(id, bl);
+ }
::decode(name, bl);
+ if (struct_v < 4) {
+ id = name;
+ }
::decode(endpoints, bl);
if (struct_v >= 2) {
::decode(log_meta, bl);