File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1144,12 +1144,11 @@ def _socket_for_writes(self, session):
1144
1144
@contextlib .contextmanager
1145
1145
def _socket_from_server (self , read_preference , server , session ):
1146
1146
assert read_preference is not None , "read_preference must not be None"
1147
- # TODO: update this comment.
1148
1147
# Get a socket for a server matching the read preference, and yield
1149
- # sock_info, read_preference. Server Selection Spec: "SecondaryOK must
1150
- # be sent to mongods with topology type Single. If the server type is
1151
- # Mongos, follow the rules for passing read preference to mongos, even
1152
- # for topology type Single."
1148
+ # sock_info with the effective read preference. The Server Selection
1149
+ # Spec says not to send any $readPreference to standalones and to
1150
+ # always send primaryPreferred when directly connected to a repl set
1151
+ # member.
1153
1152
# Thread safe: if the type is single it cannot change.
1154
1153
topology = self ._get_topology ()
1155
1154
single = topology .description .topology_type == TOPOLOGY_TYPE .Single
You can’t perform that action at this time.
0 commit comments