Commit Graph

250 Commits

Author SHA1 Message Date
Shane Harvey
a886922157 PYTHON-1684 Support sharded transactions recovery token (#406)
Transient errors inside transaction unpins the session.
Add brief docs about sharded transactions and add 3.9 changelog.
Tests changes:
Add spec tests for sharded transaction recoveryToken.
Speed up txn tests by reducing SDAM waiting time after a network error.
Remove outdated test workaround for killAllSessions.
2019-02-27 13:28:06 -08:00
Shane Harvey
05565783d9 PYTHON-1759 Find/getMore command failures reset servers's SDAM state (#406) 2019-02-27 13:25:43 -08:00
Prashant Mital
4cdd3450ac
PYTHON-1670: Implement Unified URI Options (#386) 2019-01-17 10:02:37 -08:00
Shane Harvey
ecc852c322 PYTHON-1673 Mongos pinning for sharded transactions
In a sharded transaction, a session is pinned to the mongos server
selected for the initial command. All subsequent commands in the same
transaction are routed to the pinned mongos server.
2018-12-06 15:28:58 -08:00
Shane Harvey
6fe00109c1 PYTHON-1650 Always increment txnNumber before starting a retryable write 2018-10-08 11:42:02 -07:00
Prashant Mital
bc26c0db69
PYTHON-1577 Allow applications to register a custom server selector (#371)
PYTHON-1577 Allow applications to register a custom server selector
2018-08-30 17:33:03 -05:00
Felipe Rodrigues
6afcf14f4f Add class docstring to MongoClient (#372) 2018-08-24 10:09:17 -07:00
Didi Bar-Zev
ff958b7d67 PYTHON-1617 Fix database name check in index cache (#363) 2018-07-25 10:18:25 -07:00
Shane Harvey
4f3b6467ab PYTHON-1598 Fix transaction write concern inheritance 2018-06-26 12:07:12 -04:00
Shane Harvey
98e77ba1d2 PYTHON-1483 Prohibit unack'ed writes with explicit sessions 2018-06-25 13:55:50 -05:00
Prashant Mital
96291c88b0
PYTHON-1565 Add helpers and options for Change Streams Follow-on Work (#355)
PYTHON-1565 Add helpers and options for Change Streams Follow-on Work (#355)

Add MongoClient.watch() and Database.watch().
Add start_at_operation_time to all watch() helpers.
2018-06-21 12:22:59 -07:00
Bernie Hackett
709b28467f PYTHON-1586 - Deprecate database_names and collection_names 2018-06-18 10:52:11 -07:00
Shane Harvey
622d33d0cb PYTHON-1545 Support for retryable writeConcernErrors
Return proper BulkWriteResult after a retryable write succeeds.
Reduce retryable writes test suite time from 90 to 30 seconds by
reducing the heartbeat interval.
2018-06-14 09:51:08 -07:00
Shane Harvey
e4317d286b PYTHON-1508 Retryable commit/abort, has_error_label api
Retryable commitTransaction/abortTransaction.
Retry writes after certain writeConcernErrors.
Add has_error_label api.
Update unacknowledged write concern error messge.
Resync transaction tests and update test runner.
2018-06-07 14:39:52 -07:00
Shane Harvey
96aeb461f9 PYTHON-1545 Consider more errors retryable 2018-06-07 14:37:01 -07:00
Bernie Hackett
548343c29e PYTHON-1551 - Deprecate MongoClient.close_cursor 2018-06-06 11:17:02 -07:00
A. Jesse Jiryu Davis
c63c068611 PYTHON-1564 Add DriverInfo to handshake metadata
Allow drivers that wrap PyMongo to add their info to the handshake
metadata, using a "driver" option like:

  MongoClient(driver=DriverInfo("MyDriver", "1.2.3"))

The DriverInfo is appended to PyMongo's own metadata.
2018-06-03 10:04:45 -04:00
Shane Harvey
cac0d5548f PYTHON-1508 Remove autoStartTransaction and resync tests
Also use the test file's database name and collection name.
2018-05-22 13:29:41 -07:00
Bernie Hackett
335cb97a34 PYTHON-1278, PYTHON-1553 - Support OP_COMPRESSED 2018-05-22 11:44:21 -07:00
Shane Harvey
5a652be993 PYTHON-1508 Add read_preference to TransactionOptions
All read operations use the transaction's read preference.
Add transaction read preference spec tests.
Remove write test in test_read_preferences.
2018-05-08 11:38:28 -07:00
Shane Harvey
09891a4ff3 Bring autoStartTransaction up to spec 2018-04-16 09:57:45 -04:00
Shane Harvey
b4f153a811 Add and test default_transaction_options 2018-04-16 09:57:45 -04:00
Shane Harvey
a2937aa8eb Revert "Pin transactions to a single server address"
This reverts commit 25bc0858ff566abfabadeca4a3fea177e9c2697c.
2018-04-16 09:57:45 -04:00
Shane Harvey
712637ac8b Refactor transaction attributes into _Transaction class
Re-sync transaction spec tests.
2018-04-16 09:57:45 -04:00
Shane Harvey
015cdf1fb6 Session may be None in retryable write code path 2018-04-16 09:57:45 -04:00
Shane Harvey
49494c2548 Add support for start_transaction with-statement 2018-04-16 09:57:45 -04:00
Shane Harvey
656aa1e703 Pin transactions to a single server address 2018-04-16 09:57:45 -04:00
Shane Harvey
cd92850b36 Test changing transaction readPreference
Add original readPreference to getMores to simplify code check.
2018-04-16 09:57:45 -04:00
A. Jesse Jiryu Davis
9df87b6401 prototype transaction tests 2018-04-16 09:57:45 -04:00
Bernie Hackett
3cd6f32e7c PYTHON-1509 - Update auth docs for SCRAM-SHA-256 2018-03-30 19:17:35 -07:00
Shane Harvey
251df6abd1 PYTHON-1482 Fix maxIdleTime reaper calculation 2018-02-21 17:01:03 -08:00
Bernie Hackett
6391d0b499 PYTHON-1455 - Fix fsync test for Python 3.7+ 2018-02-12 19:24:09 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Shane Harvey
2a05236f61 PYTHON-1332 Only gossip cluster time on >= 3.6.
Do not add readConcern to explain.
Test explain with collation.
2017-11-30 14:53:14 -08:00
Bernie Hackett
e42897e79e PYTHON-1418 - More spec updates 2017-11-29 10:52:05 -08:00
Shane Harvey
e554d6116c PYTHON-1419 Call endSessions on MongoClient.close. 2017-11-28 14:26:25 -08:00
Shane Harvey
47302096f9 PYTHON-1339 Retryable multi-statement writes.
MongoClient with retryWrites=true works when the cluster does not support retryable writes.
2017-11-20 12:18:00 -08:00
Shane Harvey
b669cd86dc PYTHON-1332 Session may only be used by the client that started it.
Centralize $clusterTime receiving.
2017-11-17 09:27:21 -08:00
Shane Harvey
49cee292cc PYTHON-1408 Cursor iteration should complete when another thread closes the cursor.
Closing a cursor should not raise an error when killCursors fails.
2017-11-13 13:08:38 -08:00
Bernie Hackett
4eda4ffaec PYTHON-1340 - Implement causally consistent reads 2017-11-09 17:16:55 -08:00
Shane Harvey
8b1aa3aafa PYTHON-1339 Retryable single-statement writes.
Add retryWrites MongoClient and URI setting.
Retry once for supported single-statement write operations including:
insert_one, update_one, delete_one, find_one_and_update, find_one_and_replace,
find_one_and_delete, update and remove with multi=False, and find_and_modify.
2017-10-30 14:23:16 -04:00
Bernie Hackett
5d05ad2748 PYTHON-1379 - Implement Database Enumeration spec 2017-10-24 13:24:56 -07:00
Bernie Hackett
732b0f15df PYTHON-1378 - Implement DNS seedlist discovery 2017-10-19 13:53:02 -07:00
A. Jesse Jiryu Davis
df018e88e2 PYTHON-1332 - Gossip $clusterTime 2017-10-12 09:08:38 -04:00
Shane Harvey
f0b847adb8 PYTHON-1329 Refactor wire protocol message parsing.
Use _OpReply class instead of passing bytes around.
Remove unnecessary operation argument to receive message.
Move _first_batch to message.py to avoid circular import.
2017-10-09 15:11:50 -07:00
A. Jesse Jiryu Davis
41096d5875 PYTHON-1332 - Check current user owns session 2017-10-02 12:05:11 -04:00
A. Jesse Jiryu Davis
6fa2e4047f PYTHON-1332 - Send lsid with all commands 2017-09-29 14:52:26 -04:00
A. Jesse Jiryu Davis
c1ec855060 PYTHON-1332 - Send lsid with all commands 2017-09-29 14:52:26 -04:00
A. Jesse Jiryu Davis
25b00e43e8 PYTHON-1332 - Use SON for fsyncUnlock command
Ensures the command name remains the first key once lsid is added.
2017-09-14 09:00:31 -04:00
A. Jesse Jiryu Davis
afb6a931d7 PYTHON-1332 - Session param for client methods 2017-09-11 17:46:44 -04:00