Commit Graph

161 Commits

Author SHA1 Message Date
Julius Park
02a9df69f6
PYTHON-3227 Clustered Indexes for all Collections (#971) 2022-06-15 13:16:22 -07:00
Shane Harvey
890cd26e1a
PYTHON-3288 Implement client side operation timeout (#954)
Add timeoutMS URI option and MongoClient keyword argument.
Add provisional/beta pymongo.timeout() api to set a deadline for a block of operations.
2022-06-06 15:36:52 -04:00
Julius Park
6b088ffa4e
PYTHON-3241 Add Queryable Encryption API to AutoEncryptionOpts (#957) 2022-06-06 12:33:31 -04:00
Steven Silvester
21ead3a7e5
PYTHON-3189 Change Stream event document missing to field for rename events (#924) 2022-05-06 16:48:02 -05:00
Shane Harvey
75685c006c
PYTHON-3235 Drop support for Python 3.6 (#939) 2022-05-05 16:13:41 -07:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
f4cef37328
PYTHON-3064 Add typings to test package (#844) 2022-02-07 19:33:41 -06:00
Shane Harvey
c94a3ad1df
PYTHON-2585 Remove legacy multi-auth code (#816) 2021-12-09 18:00:41 -08:00
Shane Harvey
e154642968
Removed references to outdated server versions (#812) 2021-12-07 15:47:28 -08:00
Bernie Hackett
111552281d
PYTHON-2921 Fix eventlet detection with Python 3.10 (#744) 2021-09-24 14:16:29 -07:00
Shane Harvey
968ee7ba96
PYTHON-2868 Test Serverless behind a load balancer (#742) 2021-09-23 15:57:57 -07:00
Julius Park
3b8961a76e
PYTHON-2679 Auto discover replica sets by default (#716) 2021-09-14 14:00:13 -07:00
Bernie Hackett
f64c5aa940 PYTHON-2904 Further language modernization 2021-09-14 12:24:06 -07:00
Bernie Hackett
ad4315134c PYTHON-2803 Get rid of most uses of 'master'
This change also resolves PYTHON-2848 for MongoDB 4.0.
2021-09-13 12:50:49 -07:00
Bernie Hackett
146179db53 PYTHON-2803 Eliminate the use of 'slave' 2021-09-13 12:47:24 -07:00
Prashant Mital
f07da34f97
PYTHON-2545 Test Atlas Serverless (#664) 2021-07-27 16:35:09 -07:00
Bernie Hackett
f11be6cfa6 PYTHON-2586 Changes to support Python 3.10 2021-06-23 11:21:41 -07:00
Shane Harvey
4c77d7c855
PYTHON-2677 Better wait queue timeout errors for load balanced clusters (#639)
Remove checkout argument in favor of SocketInfo.pin_txn/pin_cursor()
2021-06-21 18:29:36 -07:00
Bernie Hackett
fd9391df5c PYTHON-2557 Timeseries collection support
This change also resolves PYTHON-2604.
2021-06-16 14:34:12 -07:00
Shane Harvey
c8f32a7a37 PYTHON-2673 Connection pinning behavior for load balanced clusters (#630)
Tweak spec test because pymongo unpins cursors eagerly after errors.
Tweak spec test for PoolClearedEvent ordering when MongoDB handshake fails (see DRIVERS-1785).
Only skip killCursors for some error codes.
Rely on SDAM error handling to close the connection after a state change error.
Add service_id to various events.
Retain reference to pinned sockets to prevent premptive closure by CPython's cyclic GC.
2021-06-15 14:14:56 -07:00
Shane Harvey
112ee69de8
PYTHON-2674 Pool.reset only clears connections to the given serviceId (#628) 2021-06-15 09:52:30 -07:00
Shane Harvey
93ac5e0277
PYTHON-2676 Add load balancer tests in EVG (#625)
Add load balancer spec tests
Ensure LB supports retryable reads/writes
Add assertNumberConnectionsCheckedOut, createFindCursor, ignoreResultAndError
Add PoolClearedEvent.service_id and fix isClientError unified test assertion
2021-05-27 15:05:26 -07:00
Shane Harvey
2a74601572
PYTHON-2676 Unified Test Runner changes in preparation for Load Balancer Support (#623)
Resync crud, change stream, SDAM, server_selection, transactions, uri-options, tests.
PYTHON-2348 Correctly express lack of event assertions in change stream tests.
2021-05-18 10:20:36 -07:00
Shane Harvey
92a7433035
PYTHON-2580 Provide explicit guidance on handling command errors during the handshake (#571)
Command errors during the handshake MUST use SDAM error handling rules.
Mark server unknown after auth failures.
Test network timeout errors pre/post auth.
PoolClearedError MUST NOT mark the server Unknown.
Add "authEnabled" runOn requirement for SDAM integration tests.
2021-03-16 12:51:30 -07:00
Prashant Mital
3e97712728
PYTHON-2472 add a metadataClient for CSFLE (#539) 2021-03-01 11:38:10 -08:00
Bernie Hackett
521f7b9af4 PYTHON-2133 Fix up docs
And finish deleting python 2 specific code.
2021-01-21 15:49:23 -08:00
Bernie Hackett
a72e8b8823 PYTHON-2133 Remove py2 support from test
Also delete bson/py3compat.py
2021-01-20 09:40:36 -08:00
Shane Harvey
86b40c195d
PYTHON-2462 Avoid connection storms: implement pool PAUSED state (#531)
Mark server unknown and clear the pool when background connections fail.
Eagerly evict threads from the wait queue when pool is paused. Evicted
threads will raise the following error:
AutoReconnect('localhost:27017: connection pool paused')
Introduce PoolClearedEvent and ConnectionPoolListener.pool_ready.

CMAP spec test changes:
- CMAP unit tests should not use real monitors
- Assert that CMAP threads complete all scheduled operations
2021-01-06 15:15:37 -08:00
Prashant Mital
6b0123594a
PYTHON-2033 Unified Test Format (#519) 2020-12-21 19:22:29 -08:00
Shane Harvey
e95d2187b6
PYTHON-2395 Consider connection pool health during server selection (#515)
Change the driver to maintain a count of in-progress operations to each
server (per client). When selecting a mongos server, the driver now picks
2 suitable servers at random and selects the server with fewer in-progress
operations. Previously, the driver selected a mongos server at random.
The new behavior is intended to route operations away from unhealthy or
slow servers in highly concurrent single client workloads.

PYTHON-2460 Only reset Pool.active_sockets to 0 after a fork()
2020-12-07 10:41:39 -10:00
Shane Harvey
7903a1c4e1
PYTHON-2332 Skip threaded SDAM tests when cdecimal is monkey patched (#477)
Add 60 second timeout for joining threads in SDAM tests.
2020-08-12 14:55:19 -07:00
Shane Harvey
1f4123e4bf PYTHON-2123 Streaming heartbeat protocol
MongoClient now requires 2 connections and 2 threads to each MongoDB 4.4+ server.
With one connection, the server streams (or pushes) updated heartbeat info.
With the other connection, the client periodically pings the server to
establish an accurate round-trip time (RTT). This change optimizes the
discovery of server state changes such as replica set elections.

Additional changes:
- Mark server Unknown before retrying isMaster check.
- Always reset the pool _after_ marking the server unknown.
- Configure fail point before creating the client in test SpecRunner.
- Unfreeze with replSetFreeze:0 to ensure a speedy elections in test suite.
2020-07-01 14:49:46 -07:00
Prashant Mital
74202455aa
PYTHON-2278 Fix Jython SDAM test failures 2020-06-16 15:55:21 -07:00
Shane Harvey
7099e1be8b PYTHON-2199 Reduce race conditions in SDAM error handling
Use Pool.generation and topologyVersion to reduce race conditions
SDAM error handling.
Implement SDAM error handling spec tests.
2020-04-28 16:47:13 -07:00
Shane Harvey
4c727fd9c0 PYTHON-2158 Support mechanism negotiation on the connection handshake 2020-04-28 16:43:48 -07:00
Shane Harvey
350ada10d5 PYTHON-2206 Rename pool_id to generation to better match CMAP spec 2020-04-16 11:46:54 -07:00
Shane Harvey
84f1a8c5f9 PYTHON-2144 Handle the case where the peer omits the self-signed issuer cert 2020-03-10 16:44:49 -07:00
Shane Harvey
e989be53c1 PYTHON-2088 Define how multiple phases should be handled in SDAM spec runner 2020-02-24 16:32:09 -08:00
Shane Harvey
6609cc5714 PYTHON-2098 Publish server/topology events when reseting a server due to an application error 2020-02-11 11:50:45 -08:00
Shane Harvey
d481363fd5 PYTHON-2029 Support shorter SCRAM conversation 2020-02-10 16:24:43 -08:00
Shane Harvey
5ccdf1af44 PYTHON-2118 Adjust impossible writeConcern tests for 4.4 2020-02-10 10:41:41 -08:00
Prashant Mital
ed4204f237
PYTHON-1954 Stop holding the topology lock while creating new connections 2019-12-05 09:58:58 +05:30
Shane Harvey
9cf0fbd785
PYTHON-2001 Fix warnings emitted by Python 3.8 (#428)
Fix DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
Fix DeprecationWarning: isAlive() is deprecated, use is_alive() instead
Fix SyntaxWarning: invalid escape sequence
Test Python 3.8 on Travis
2019-11-08 11:48:15 -08:00
Shane Harvey
55c8bdd346 PYTHON-1939 Add prose tests for BSON size limits and batch splitting 2019-08-13 13:35:55 -07:00
Prashant Mital
62400e548d
PYTHON-1902 DNS resolution should honor connectTimeoutMS 2019-08-09 17:04:02 -07:00
Shane Harvey
e6eecb06d1 PYTHON-1884 Implement auto encryption spec tests
Skip test for symbol type which pymongo converts to string.
Fix {} comparison with RawBSONDocument in command events.
Add support for $$type assertions.
Nicer message in check_events.
Support errorContains with empty string.
Move custom data files to custom/.
2019-08-06 16:17:39 -07:00
Prashant Mital
611c3f86b3
PYTHON-1677 Connections survive primary stepdown 2019-08-06 13:08:15 -07:00
Shane Harvey
f588412b67 PYTHON-1842 Implement Connection Monitoring and Pooling spec 2019-06-13 15:50:49 -07:00
Prashant Mital
f85a9f9450
PYTHON-1675 SRV polling for mongos discovery 2019-06-10 12:51:49 -07:00
Shane Harvey
a15266083b PYTHON-1674 Support retryable reads
Add retryReads URI option that defaults to True.
Supported read operations will be retried once after transient
network, election, and shutdown errors on MongoDB 3.6+.
Supported operations are:
listCollections, listIndexes, and listDatabases
distinct
count, estimated_document_count, count_documents
aggregate (not including $out)
find (only for the initial find command, getMore commands are not
retried).
ChangeStreams: watch (initial aggregate command).
GridFS read APIs.

Test changes:
Add retryable reads spec test runner.
Disable retryable reads in network error tests.
2019-04-25 14:28:12 -07:00