From: Orit Wasserman Date: Thu, 6 Apr 2017 19:48:28 +0000 (+0300) Subject: rgw: Add resharding flag and the new bucket instance id to RGWBucketInfo X-Git-Tag: v12.1.0~276^2~91 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=424dd652981e41b588026a168af48719afcb06c0;p=ceph-ci.git rgw: Add resharding flag and the new bucket instance id to RGWBucketInfo Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 0a7cc342c09..f8d1c01183a 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -1177,9 +1177,12 @@ struct RGWBucketInfo map mdsearch_config; + /* resharding */ + bool resharding; + string new_bucket_instance_id; void encode(bufferlist& bl) const { - ENCODE_START(18, 4, bl); + ENCODE_START(19, 4, bl); ::encode(bucket, bl); ::encode(owner.id, bl); ::encode(flags, bl); @@ -1204,10 +1207,12 @@ struct RGWBucketInfo } ::encode(creation_time, bl); ::encode(mdsearch_config, bl); + ::encode(resharding, bl); + ::encode(new_bucket_instance_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { - DECODE_START_LEGACY_COMPAT_LEN_32(18, 4, 4, bl); + DECODE_START_LEGACY_COMPAT_LEN_32(19, 4, 4, bl); ::decode(bucket, bl); if (struct_v >= 2) { string s; @@ -1267,6 +1272,10 @@ struct RGWBucketInfo if (struct_v >= 18) { ::decode(mdsearch_config, bl); } + if (struct_v >= 19) { + ::decode(resharding, bl); + ::decode(new_bucket_instance_id, bl); + } DECODE_FINISH(bl); } void dump(Formatter *f) const; @@ -1284,7 +1293,7 @@ struct RGWBucketInfo } RGWBucketInfo() : flags(0), has_instance_obj(false), num_shards(0), bucket_index_shard_hash_type(MOD), requester_pays(false), - has_website(false), swift_versioning(false) {} + has_website(false), swift_versioning(false),resharding(false) {} }; WRITE_CLASS_ENCODER(RGWBucketInfo) diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index f5f3612239e..a77024e23fd 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -738,6 +738,8 @@ void RGWBucketInfo::dump(Formatter *f) const encode_json("swift_ver_location", swift_ver_location, f); encode_json("index_type", (uint32_t)index_type, f); encode_json("mdsearch_config", mdsearch_config, f); + encode_json("resharding", resharding, f); + encode_json("new_bucket_instance_id", new_bucket_instance_id, f); } void RGWBucketInfo::decode_json(JSONObj *obj) { @@ -770,6 +772,8 @@ void RGWBucketInfo::decode_json(JSONObj *obj) { JSONDecoder::decode_json("index_type", it, obj); index_type = (RGWBucketIndexType)it; JSONDecoder::decode_json("mdsearch_config", mdsearch_config, obj); + JSONDecoder::decode_json("resharding", resharding, obj); + JSONDecoder::decode_json("new_bucket_instance_id",new_bucket_instance_id, obj); } void rgw_obj_key::dump(Formatter *f) const