Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
e11dd1d4
Commit
e11dd1d4
authored
Jan 12, 2017
by
Kevin Falcone
Committed by
GitHub
Jan 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3512 from panessa/mongo3
Ready for deploying Mongo 3.2
parents
510fc021
cf91b9b1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
CHANGELOG.md
+1
-0
playbooks/library/mongodb_replica_set
+13
-5
No files found.
CHANGELOG.md
View file @
e11dd1d4
...
...
@@ -200,6 +200,7 @@
-
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.
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
-
Added
`EDXAPP_CELERY_BROKER_USE_SSL`
to allow configuring celery to use TLS.
...
...
playbooks/library/mongodb_replica_set
View file @
e11dd1d4
...
...
@@ -206,11 +206,13 @@ def is_member_subset(old_members,new_members):
'''
# 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.
sorted_new_members
=
sorted
(
new_members
,
key
=
itemgetter
(
'_id'
))
for
member
in
sorted
(
old_members
,
key
=
itemgetter
(
'_id'
)):
for
k
in
member
:
if
member
[
k
]
!=
sorted_new_members
[
member
[
'_id'
]][
k
]:
return
False
# indexing into the list using _id before without sorting which led to failure.
old_members
,
new_members
=
[
sorted
(
k
,
key
=
itemgetter
(
'_id'
))
for
k
in
(
old_members
,
new_members
)]
for
k1
,
k2
in
zip
(
old_members
,
new_members
):
for
key
,
value
in
k1
.
items
():
if
value
!=
k2
[
key
]:
return
False
return
True
...
...
@@ -267,6 +269,12 @@ def update_replset(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
)
# 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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment