Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: set sync_from_all as true when no value is seen #18926

Merged
merged 1 commit into from Nov 16, 2017

Conversation

theanalyst
Copy link
Member

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

@@ -987,7 +987,9 @@ 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);
if (false == JSONDecoder::decode_json("sync_from_all", sync_from_all, obj)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSONDecoder has another overload that takes a default_val that looks perfect for this. see https://github.com/ceph/ceph/blob/master/src/common/ceph_json.h#L125

JSONDecoder::decode_json("sync_from_all", sync_from_all, true, obj);

(if that doesn't compile, we might need to change the T& default_val arg to const T& default_val in that overload)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

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>
@yuriw
Copy link
Contributor

yuriw commented Nov 15, 2017

@yuriw yuriw merged commit 00c95a0 into ceph:master Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants