Conversation
a6e4b0b
to
38ec2e3
Compare
Refer to this link for build results (access rights to CI server needed): |
@@ -52,6 +52,10 @@ New Features | |||
* Pulp properly connects to MongoDB replica sets. The `replica_set` setting in `database` section | |||
of `/etc/pulp/server.conf` must be provided for Pulp to connect to a replica set. | |||
|
|||
* Pulp allows user to specify the write concern for MongoDB connection. The two options are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/user/users/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/for/for the/
A few things to fix, and I'll re-review:
|
@rbarlow If a user is using Mongo 2.4, he does not have to use a replica set. Our default of 'majority' does not work without using a replica set. However, when MongoDB is running in single node mode, a write concern of 1 behaves the same way in MongoDB 2.4 as 'majority' in MongoDB 2.6. |
ok test |
ok test |
Refer to this link for build results (access rights to CI server needed): |
@@ -100,6 +100,9 @@ | |||
PLP0041 = Error("PLP0041", _("Database 'replica_set' config must be specified when more than one " | |||
"seed is provided. Refer to /etc/pulp/server.conf for proper use."), | |||
[]) | |||
PLP0043 = Error("PLP0043", _("Database 'write_concern' config can only be 'majority' or 'all'. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not 42?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhrivnak Because we already have 42 on master
Refer to this link for build results (access rights to CI server needed): |
ok test |
Refer to this link for build results (access rights to CI server needed): |
if len(seeds_list) > 1 and not replica_set: | ||
raise PulpCodedException(error_code=error_codes.PLP0041) | ||
while True: | ||
_CONNECTION = _connect_to_one_of_seeds(connection_kwargs, seeds_list, name) | ||
if _CONNECTION: | ||
db_version = semantic_version.Version(_CONNECTION.server_info()['version']) | ||
if cmp(db_version, MONGO_MINIMUM_VERSION) == -1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this (and below) would be more readable with normal comparison operators, which you can use with these objects (unless you found some edge case?). I suggest
db_version < MONGO_MINIMUM_VERSION
ok test |
Refer to this link for build results (access rights to CI server needed): |
@@ -1,18 +1,23 @@ | |||
import unittest | |||
import unittest, unittest2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last comment, I swear. ;) unittest2
is a third-party module, so it should be in the second group of imports.
ok test |
Refer to this link for build results (access rights to CI server needed): |
…nt changes Updates a particular distributor's last published timestamp closes pulp#2081 https://pulp.plan.io/issues/2081 (cherry picked from commit deabcbc)
Pulp now accepts a write concern for the MongoDB connection. All writes
to the database are now acknowledged. For replica sets, 'majority' or 'all'
members can be asked to acknowledge the write.