]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: include period id in rgw_meta_sync_info
authorCasey Bodley <cbodley@redhat.com>
Mon, 30 Nov 2015 21:33:34 +0000 (16:33 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 18 Feb 2016 22:04:19 +0000 (14:04 -0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_json_enc.cc
src/rgw/rgw_meta_sync_status.h

index 55a129bfd25dbe9dda627f54ca9aebc2d3d1a51c..03eeac6c314d141abbfc8d75e4ca1cbf844697df 100644 (file)
@@ -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)
index 2635f9cc22c8b598f1cf5f25a0c7b4a5d7258a95..5183846cb7e8f26198c0618371190b21018194af 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef RGW_META_SYNC_STATUS_H
 #define RGW_META_SYNC_STATUS_H
 
+#include <string>
+
 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);