Skip to content

Commit 60f7ac7

Browse files
committed
PYTHON-2776 Disable writes and other unsupported operations in snapshot reads (#660)
Rely on the server to report an error for unsupported snapshot read operations by sending readConcern with all commands, even writes. (cherry picked from commit fd84565)
1 parent 59b62c8 commit 60f7ac7

File tree

4 files changed

+553
-3
lines changed

4 files changed

+553
-3
lines changed

pymongo/client_session.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,9 @@ def _txn_read_preference(self):
869869
def _apply_to(self, command, is_retryable, read_preference, sock_info):
870870
self._check_ended()
871871

872+
if self.options.snapshot:
873+
self._update_read_concern(command, sock_info)
874+
872875
self._server_session.last_use = monotonic.time()
873876
command['lsid'] = self._server_session.session_id
874877

0 commit comments

Comments
 (0)