]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: zone placement info includes extra data pool
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 11 Mar 2014 19:26:23 +0000 (12:26 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 24 Mar 2014 21:58:05 +0000 (14:58 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_json_enc.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 044414a6df59f0cb406f5dd905b5440ba4a252ed..4df7dafb4bfc7125bdcc5122b81df2742041b688 100644 (file)
@@ -616,12 +616,14 @@ void RGWZonePlacementInfo::dump(Formatter *f) const
 {
   encode_json("index_pool", index_pool, f);
   encode_json("data_pool", data_pool, f);
+  encode_json("data_extra_pool", data_extra_pool, f);
 }
 
 void RGWZonePlacementInfo::decode_json(JSONObj *obj)
 {
   JSONDecoder::decode_json("index_pool", index_pool, obj);
   JSONDecoder::decode_json("data_pool", data_pool, obj);
+  JSONDecoder::decode_json("data_extra_pool", data_extra_pool, obj);
 }
 
 void RGWZoneParams::decode_json(JSONObj *obj)
index cb82e05e225df38289a1c81bff10ded0ef5698b5..5b320307a2c6fb0db6f776f94ccde43ffd1b198f 100644 (file)
@@ -2479,6 +2479,7 @@ int RGWRados::set_bucket_location_by_rule(const string& location_rule, const std
   RGWZonePlacementInfo& placement_info = piter->second;
 
   bucket.data_pool = placement_info.data_pool;
+  bucket.data_extra_pool = placement_info.data_extra_pool;
   bucket.index_pool = placement_info.index_pool;
 
   return 0;
index 2263ae6242aab882634dfde9ba51a608e1e99345..e59b3b98918eaf88e13069c988567517019cea53 100644 (file)
@@ -739,20 +739,31 @@ struct RGWRegion;
 struct RGWZonePlacementInfo {
   string index_pool;
   string data_pool;
+  string data_extra_pool; /* if not set we should use data_pool */
 
   void encode(bufferlist& bl) const {
-    ENCODE_START(3, 1, bl);
+    ENCODE_START(4, 1, bl);
     ::encode(index_pool, bl);
     ::encode(data_pool, bl);
+    ::encode(data_extra_pool, bl);
     ENCODE_FINISH(bl);
   }
 
   void decode(bufferlist::iterator& bl) {
-    DECODE_START(1, bl);
+    DECODE_START(4, bl);
     ::decode(index_pool, bl);
     ::decode(data_pool, bl);
+    if (struct_v >= 4) {
+      ::decode(data_extra_pool, bl);
+    }
     DECODE_FINISH(bl);
   }
+  const string& get_data_extra_pool() {
+    if (data_extra_pool.empty()) {
+      return data_pool;
+    }
+    return data_extra_pool;
+  }
   void dump(Formatter *f) const;
   void decode_json(JSONObj *obj);
 };