From: Casey Bodley Date: Mon, 30 Nov 2015 21:33:34 +0000 (-0500) Subject: rgw: include period id in rgw_meta_sync_info X-Git-Tag: v10.1.0~354^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c990d22f209801af5c9cafbd9fa857952b2e6f7;p=ceph.git rgw: include period id in rgw_meta_sync_info Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 55a129bfd25..03eeac6c314 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -1135,6 +1135,8 @@ void rgw_meta_sync_info::decode_json(JSONObj *obj) state = StateSync; } JSONDecoder::decode_json("num_shards", num_shards, obj); + JSONDecoder::decode_json("period", period, obj); + JSONDecoder::decode_json("realm_epoch", realm_epoch, obj); } void rgw_meta_sync_info::dump(Formatter *f) const @@ -1156,6 +1158,8 @@ void rgw_meta_sync_info::dump(Formatter *f) const } encode_json("status", s, f); encode_json("num_shards", num_shards, f); + encode_json("period", period, f); + encode_json("realm_epoch", realm_epoch, f); } void rgw_meta_sync_marker::decode_json(JSONObj *obj) diff --git a/src/rgw/rgw_meta_sync_status.h b/src/rgw/rgw_meta_sync_status.h index 2635f9cc22c..5183846cb7e 100644 --- a/src/rgw/rgw_meta_sync_status.h +++ b/src/rgw/rgw_meta_sync_status.h @@ -1,6 +1,8 @@ #ifndef RGW_META_SYNC_STATUS_H #define RGW_META_SYNC_STATUS_H +#include + struct rgw_meta_sync_info { enum SyncState { StateInit = 0, @@ -10,19 +12,27 @@ struct rgw_meta_sync_info { uint16_t state; uint32_t num_shards; + std::string period; //< period id of current metadata log + epoch_t realm_epoch = 0; //< realm epoch of period void encode(bufferlist& bl) const { - ENCODE_START(1, 1, bl); + ENCODE_START(2, 1, bl); ::encode(state, bl); ::encode(num_shards, bl); + ::encode(period, bl); + ::encode(realm_epoch, bl); ENCODE_FINISH(bl); } void decode(bufferlist::iterator& bl) { - DECODE_START(1, bl); - ::decode(state, bl); - ::decode(num_shards, bl); - DECODE_FINISH(bl); + DECODE_START(1, bl); + ::decode(state, bl); + ::decode(num_shards, bl); + if (struct_v >= 2) { + ::decode(period, bl); + ::decode(realm_epoch, bl); + } + DECODE_FINISH(bl); } void decode_json(JSONObj *obj); @@ -58,14 +68,14 @@ struct rgw_meta_sync_marker { } void decode(bufferlist::iterator& bl) { - DECODE_START(1, bl); + DECODE_START(1, bl); ::decode(state, bl); ::decode(marker, bl); ::decode(next_step_marker, bl); ::decode(total_entries, bl); ::decode(pos, bl); ::decode(timestamp, bl); - DECODE_FINISH(bl); + DECODE_FINISH(bl); } void decode_json(JSONObj *obj);