Commit e11dd1d4 by Kevin Falcone Committed by GitHub

Merge pull request #3512 from panessa/mongo3

Ready for deploying Mongo 3.2
parents 510fc021 cf91b9b1
...@@ -200,6 +200,7 @@ ...@@ -200,6 +200,7 @@
- Role: mongo_3_0 - Role: mongo_3_0
- Changed MONGO_STORAGE_ENGINE to default to wiredTiger which is the default in 3.2 and 3.4 and what edX suggests be used even on 3.0. - Changed MONGO_STORAGE_ENGINE to default to wiredTiger which is the default in 3.2 and 3.4 and what edX suggests be used even on 3.0.
If you have a mmapv1 3.0 install, override MONGO_STORAGE_ENGINE to be mmapv1 which was the old default. If you have a mmapv1 3.0 install, override MONGO_STORAGE_ENGINE to be mmapv1 which was the old default.
- Support parsing the replset JSON in 3.2 and 3.0
- Role: xqueue - Role: xqueue
- Added `EDXAPP_CELERY_BROKER_USE_SSL` to allow configuring celery to use TLS. - Added `EDXAPP_CELERY_BROKER_USE_SSL` to allow configuring celery to use TLS.
......
...@@ -206,11 +206,13 @@ def is_member_subset(old_members,new_members): ...@@ -206,11 +206,13 @@ def is_member_subset(old_members,new_members):
''' '''
# Mongo returns the member set in no particular order, and we were # Mongo returns the member set in no particular order, and we were
# indexing into the list using _id before witout sorting which led to failure. # indexing into the list using _id before without sorting which led to failure.
sorted_new_members = sorted(new_members, key=itemgetter('_id')) old_members, new_members = [sorted(k, key=itemgetter('_id'))
for member in sorted(old_members, key=itemgetter('_id')): for k in (old_members, new_members)]
for k in member:
if member[k] != sorted_new_members[member['_id']][k]: return False for k1, k2 in zip(old_members, new_members):
for key, value in k1.items():
if value != k2[key]: return False
return True return True
...@@ -267,6 +269,12 @@ def update_replset(rs_config): ...@@ -267,6 +269,12 @@ def update_replset(rs_config):
if not check_config_subset(rs_config, changed_rs_config): if not check_config_subset(rs_config, changed_rs_config):
module.fail_json(msg="Failed to validate that the replica set was changed", new_config=changed_rs_config, config=rs_config) module.fail_json(msg="Failed to validate that the replica set was changed", new_config=changed_rs_config, config=rs_config)
# Remove settings from changed_rs_config before exit to avoid
# problem with exit_json() and unserializable ObjectId
# because MongoDB returns JSON which is not serializable
if changed_rs_config.get('settings') is not None:
changed_rs_config['settings'] = None
module.exit_json(changed=changed, config=rs_config, new_config=changed_rs_config) module.exit_json(changed=changed, config=rs_config, new_config=changed_rs_config)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment