- Done: Add retryWrites MongoClient and URI option.
- Done: Add monotonically increasing txnNum to server sessions.
- Done: Add retryable behavior to insert_one, update_one, replace_one, delete_one, find_one_and_*
- Done: Refactor _do_batch_write_command to generate a single message.
- Done: Add retryable behavior to insert_many and bulk_write.
Handle txnNum overflow by throwing an error and/or discarding server sessions with very high txnNums.
- Handling overflow is not necessary in practice. It would take roughly 300,000 years with 1 million transactions per second (with a single session) for the transaction id to overflow. On the off chance it does overflow, PyMongo's bson library will throw an OverflowError anyway.