Skip to content

Commit 94e2b10

Browse files
committed
PYTHON-1959 Use read/writeConcern majority for key vault operations
1 parent af0f6fd commit 94e2b10

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pymongo/encryption.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"""
2020

2121
import contextlib
22-
import functools
2322
import subprocess
2423
import uuid
2524
import weakref
@@ -52,7 +51,9 @@
5251
ServerSelectionTimeoutError)
5352
from pymongo.mongo_client import MongoClient
5453
from pymongo.pool import _configured_socket, PoolOptions
54+
from pymongo.read_concern import ReadConcern
5555
from pymongo.ssl_support import get_ssl_context
56+
from pymongo.write_concern import WriteConcern
5657

5758

5859
_HTTPS_PORT = 443
@@ -88,7 +89,9 @@ def __init__(self, client, key_vault_coll, mongocryptd_client, opts):
8889
else:
8990
self.client_ref = None
9091
self.key_vault_coll = key_vault_coll.with_options(
91-
codec_options=_KEY_VAULT_OPTS)
92+
codec_options=_KEY_VAULT_OPTS,
93+
read_concern=ReadConcern(level='majority'),
94+
write_concern=WriteConcern(w='majority'))
9295
self.mongocryptd_client = mongocryptd_client
9396
self.opts = opts
9497
self._spawned = False

0 commit comments

Comments
 (0)