Commit Graph

51 Commits

Author SHA1 Message Date
Bernie Hackett
ba7c95a9df PYTHON-1462 - Import ABCs from collections.abc 2018-02-12 19:42:44 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Shane Harvey
9468c119a3 PYTHON-1335 Improve __slots__ usage.
__slots__ must be defined in all classes in the hierarchy to avoid __dict__
and __weakref__ overhead.
2017-08-03 14:57:43 -07:00
Michael Elovskikh
9f07ff35a1 PYTHON-1334 Don't change readpreference value at uri parsing (#325) 2017-07-25 17:43:51 -07:00
A. Jesse Jiryu Davis
91f2f973af PYTHON-1192 - Minimum maxStalenessSeconds is 90.
Revert code to parse "idleWritePeriodMillis" from ismaster, and revert
changes that allowed maxStalenessSeconds to be a float.
2016-11-22 13:19:34 -05:00
A. Jesse Jiryu Davis
87708a2f96 PYTHON-1169 - Default maxStalenessSeconds is -1. 2016-11-08 21:52:04 -05:00
A. Jesse Jiryu Davis
873dc22f64 PYTHON-1185 - maxStalenessSeconds can be a float.
PyMongo had cast to int before sending to mongos.
2016-11-08 21:52:04 -05:00
A. Jesse Jiryu Davis
f4922da97c PYTHON-1104 - maxStalenessMS -> maxStalenessSeconds. 2016-11-08 21:52:04 -05:00
Bernie Hackett
5f16e33a6d PYTHON-1150 - Add maxStalenessMS to $readPreference 2016-09-19 11:09:41 -07:00
Bernie Hackett
1a45a0fa08 Changelog for PyMongo 3.4 2016-09-16 14:31:20 -07:00
A. Jesse Jiryu Davis
5933730588 PYTHON-1104 Implement maxStalenessMS. 2016-07-22 14:12:40 -04:00
A. Jesse Jiryu Davis
553f887ef7 PYTHON-1104 Change server-selector signature.
Preparation for maxStalenessMS implementation: selectors now take a
TopologyDescription, not a list of ServerDescriptions.
2016-06-20 15:27:17 -07:00
aherlihy
aab0bd5c46 PYTHON-962 - NotImplemented instead of NotImplementedError 2015-07-21 12:13:46 -04:00
A. Jesse Jiryu Davis
c31d4808bf PYTHON-922 - Read preferences support copy and pickle. 2015-05-04 21:43:36 -04:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
a5cdb2f652 PYTHON-798 - Improve docs and add examples. 2015-03-19 13:03:48 -07:00
Bernie Hackett
3bcbe0682d PYTHON-858 - Clean up high availability docs. 2015-03-11 19:28:54 -07:00
A. Jesse Jiryu Davis
d80c5a8e39 Merge pull request #254 from aherlihy/squashed-PYTHON-815
Python 815: Added Server-Selection YAML tests.
2015-03-08 08:24:19 -04:00
aherlihy
ec213e0067 PYTHON-815: Added YAML tests for server selection. 2015-03-06 15:21:24 -05:00
Bernie Hackett
d69f76d380 Finalize option locations and exports.
- Move ReturnDocument to pymongo.collection.
- Change ReturnDocument.Before to ReturnDocument.BEFORE
- Change ReturnDocument.After to ReturnDocument.AFTER
- Add pymongo.cursor.CursorType.
- Move pymongo.cursor.NON_TAILABLE and friends to attributes of CursorType.
- read_preferences.ReadPreference is once again an "enum".
- Fix docs for read_preferences.ReadPreference.
- Rename pymongo.options to pymongo.operations.
- Export CursorType, ReturnDocument, WriteConcern, and public classes
  from pymongo.opertions through pymongo/__init__.py
- Fix up a number of documentation issues in the process.
2015-03-05 11:35:46 -08:00
Bernie Hackett
8f0bd0a6d4 PYTHON-850 - Change some uses of ConfigurationError to Type/ValueError. 2015-02-26 16:02:25 -08:00
Bernie Hackett
7164ba2f41 PYTHON-839 - Better validation error messages. 2015-02-25 10:14:29 -08:00
A. Jesse Jiryu Davis
acd90be727 Reset average round trip time if a server is disconnected.
The Server Discovery And Monitoring Spec says if a server "changes from a known
type to Unknown its RTT is set to null."
2015-01-26 15:38:24 -05:00
Bernie Hackett
755d5c74eb PYTHON-814 - API and behavior changes for Database.command.
Database.command no longer obeys Database.read_preference or
Database.codec_options. Explicit parameters have been added
for both options. See the ticket for a full explanation.
2015-01-09 13:18:36 -08:00
Bernie Hackett
4e13a39db9 PYTHON-812 - Make local threshold global and immutable. 2015-01-08 11:21:54 -08:00
Bernie Hackett
a788b1f1aa PYTHON-811 - latencyThresholdMS -> localThresholdMS 2015-01-08 11:21:44 -08:00
A. Jesse Jiryu Davis
ecc55f502a New method to calculate average round trip time.
Replace 5-sample moving average with exponentially weighted average,
required by the upcoming Server Selection Spec. Move responsibility for
tracking the average from ServerDescription to Monitor. Now the
ServerDescription only knows the average at the time it was created.
2014-12-03 16:30:35 -05:00
A. Jesse Jiryu Davis
ff7958ad38 PYTHON-525 Helpful connection error messages. 2014-11-18 12:14:35 -05:00
A. Jesse Jiryu Davis
026757fd0d Unused imports. 2014-11-17 16:12:18 -05:00
A. Jesse Jiryu Davis
f3546cc77b PYTHON-525 Update replica set docs for new MongoClient.
Also improve RST markup and fix duplicate reference targets in docstrings.
2014-09-26 19:30:47 -04:00
A. Jesse Jiryu Davis
a0330f7b63 PYTHON-525 Update ReadPreference doc. 2014-09-24 16:09:36 -04:00
A. Jesse Jiryu Davis
1236e58bc4 Fix docs for latency_threshold_ms. 2014-09-24 16:09:36 -04:00
A. Jesse Jiryu Davis
735a1247ca PYTHON-525 Deprecate MongoReplicaSetClient.
MongoClient now supports all MongoReplicaSetClient's features.
Fix bugs and add features in the new MongoClient to bring it up
to spec. MongoReplicaSetClient is now a deprecated stub that
subclasses MongoClient.

Introduce new errors, NetworkTimeout and NotMasterError, to
communicate events that MongoClient must handle specially.
2014-09-16 15:33:19 -04:00
A. Jesse Jiryu Davis
3027853cd9 PYTHON-525 Server selection implemented within ReadPreference classes. 2014-08-28 16:49:33 -04:00
Luke Lovett
17fb3a2a02 PYTHON-505 Allow C extensions to encode any mapping type, not just dicts. 2014-08-13 16:16:25 +00:00
Bernie Hackett
be35ff71a2 PYTHON-719 Read preference backward compatibility
This commit does a few things:

- Adds tag_sets back (deprecated)
- Adds secondary_acceptable_latency_ms back (deprecated)
- Makes acceptable latency a per read preference setting
- Cleans up read preference instance generation
- Adds latencyThresholdMS as an alias for secondaryAcceptableLatencyMS.
The name may change before 3.0 is released.
2014-06-27 15:05:20 -07:00
Bernie Hackett
92e7eea8de Fix an issue with mongos read preferences. 2014-06-25 17:42:27 -07:00
Bernie Hackett
f5c71a5376 PYTHON-672 - Add __ne__ to read preferences 2014-04-22 17:31:26 -07:00
behackett
e0b52baf8e PYTHON-672 - Make read preference a class
This commit introduces the following changes:

- Each read preference is now a class.
- Read preferences other than Primary accept a tag_sets parameter.
- The tag_sets attribute of MongoClient, Database, and Collection has
  been removed. Use the tag_sets parameter of the new classes instead.
- The read_preferences.ReadPreference constant still exists and should
continue to work as expected for most users.
2014-04-14 16:28:07 -07:00
A. Jesse Jiryu Davis
7a2f40a31c Collection.parallel_scan should obey read preference. 2014-02-13 18:32:32 -05:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
A. Jesse Jiryu Davis
c542fa368e RS client remembers the host list from last ismaster response, uses it like a seed list if current hosts are unreachable, PYTHON-600. 2013-12-07 14:26:56 -05:00
A. Jesse Jiryu Davis
35e6e986ee Enable text search on secondaries. PYTHON-530 2013-06-29 19:20:29 -04:00
A. Jesse Jiryu Davis
6c2e009f45 Fix MongoReplicaSetClient race conditions PYTHON-467
* RSState, Member, and MovingAverage are now immutable
* In refresh(), try up members before down ones
* A test_ha fixup (clear process-list after killing them in each test, so we don't re-kill previous tests' processes)
2013-05-01 14:14:20 -04:00
Craig Hobbs
f56460b293 Fix uri_parser read_preference validation 2013-01-23 11:03:38 -08:00
A. Jesse Jiryu Davis
622504b3e3 Synchronize the MovingAverage data structure 2012-12-31 11:37:03 -05:00
A. Jesse Jiryu Davis
34f67588ea Replica set members not in primary/secondary state should not receive reads PYTHON-455
Ensure class Member knows if it represents a member not in primary or secondary state, and use that info in matches_mode() and select_member()
2012-12-24 14:33:56 -06:00
A. Jesse Jiryu Davis
16c50cbccd Update ReadPreference docs
Particularly, fix the description of what happens with direct connection
to primary with ReadPreference.SECONDARY: it doesn't fail, it succeeds.
2012-12-05 10:00:06 -05:00
behackett
2b0c5e73ce Fix $cmd queries with $readPreference PYTHON-446 2012-12-01 20:21:05 -08:00
behackett
03593d512c Allow auth with RSC during failover PYTHON-388 2012-08-13 10:11:03 -07:00