As described in the steps to reproduce, the shell failed to connect to a secondary even though the connection string specifies read preference "secondary" according to the documentation.
URI option support isn't consistent and user-friendly in the shell. Some URI options are supported. For example a wrong "replicaSet" option will be detected as it fails to connect. However read preference is ignored silently. Initially I thought my options were wrong or read preference has to be given together with "replicaSet" or the database was misconfigured when I tried to connect the data warehouse not owned by my team. Misspelling an option is also a silent error. For example, "replSet" option will be ignored silently.
The shell seems the easiest way to try out read preferences settings, so I feel the lack of support is a bug. As least, the unsupported or unknown URI options should be an explicit error.
- related to
-
SERVER-39222 mongo shell should parse readPreference and readPreferenceTags from connection string
- Closed
- mentioned in
-
Page Loading...