]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set sync_from_all as true when no value is seen 18926/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 14 Nov 2017 16:39:16 +0000 (17:39 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Tue, 14 Nov 2017 18:42:13 +0000 (19:42 +0100)
In order to support jewel-luminous multisite scenarios where when a
jewel cluster is the master, the sync-from-all json field wouldn't be
set leading to the secondary not syncing data as this value can't be
overriden to true, so defaulting the value of sync_from_all to true when
we don't encounter it in the json

Fixes: http://tracker.ceph.com/issues/22062
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/common/ceph_json.h
src/rgw/rgw_json_enc.cc

index cd868a88f4ed134fec87f58e11d2c4117f682938..08ec5e59a2882796110767e5ea37910ad785ab05 100644 (file)
@@ -122,7 +122,7 @@ public:
   static bool decode_json(const char *name, C& container, void (*cb)(C&, JSONObj *obj), JSONObj *obj, bool mandatory = false);
 
   template<class T>
-  static void decode_json(const char *name, T& val, T& default_val, JSONObj *obj);
+  static void decode_json(const char *name, T& val, const T& default_val, JSONObj *obj);
 };
 
 template<class T>
@@ -304,7 +304,7 @@ bool JSONDecoder::decode_json(const char *name, C& container, void (*cb)(C&, JSO
 }
 
 template<class T>
-void JSONDecoder::decode_json(const char *name, T& val, T& default_val, JSONObj *obj)
+void JSONDecoder::decode_json(const char *name, T& val, const T& default_val, JSONObj *obj)
 {
   JSONObjIter iter = obj->find_first(name);
   if (iter.end()) {
index ad7b941bf3ad53f9906bcadd9157d6832afc674e..a67f1ac1861000fd55961ba00c930fac1f609611 100644 (file)
@@ -987,7 +987,7 @@ void RGWZone::decode_json(JSONObj *obj)
   JSONDecoder::decode_json("bucket_index_max_shards", bucket_index_max_shards, obj);
   JSONDecoder::decode_json("read_only", read_only, obj);
   JSONDecoder::decode_json("tier_type", tier_type, obj);
-  JSONDecoder::decode_json("sync_from_all", sync_from_all, obj);
+  JSONDecoder::decode_json("sync_from_all", sync_from_all, true, obj);
   JSONDecoder::decode_json("sync_from", sync_from, obj);
 }