summaryrefslogtreecommitdiff
path: root/src/mongo/client/sdam
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/client/sdam
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/client/sdam')
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/README.rst12
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible_unknown.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_arbiters.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_passives.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_primary.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_secondary.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json8
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json.notused8
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/equal_electionids.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/ghost_discovered.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/hosts_differ_from_seeds.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_arbiter.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_ghost.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_other.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/ls_timeout.json12
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/member_reconfig.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/member_standalone.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_electionid.json6
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_setversion.json6
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_wrong_set_name.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case.json.disabled2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case_me.json.disabled4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/null_election_id.json8
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_ghost.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_mongos.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_standalone.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_changes_set_name.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_electionid.json10
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_setversion.json10
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_hint_from_secondary_with_mismatched_me.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_mismatched_me.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_reports_new_member.json8
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_to_no_primary_mismatched_me.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_wrong_set_name.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/response_from_removed.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/rsother_discovered.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/sec_not_auth.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_ignore_ok_0.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_mismatched_me.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name_with_primary.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/set_version_can_rollback.json6
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/setversion_without_electionid.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/stepdown_change_set_name.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/too_new.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/too_old.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/unexpected_mongos.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/use_setversion_without_electionid.json6
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/rs/wrong_set_name.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/compatible.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/ls_timeout_mongos.json8
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/mongos_disconnect.json6
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/multiple_mongoses.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/non_mongos_removed.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_new.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_old.json4
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/compatible.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_external_ip.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_mongos.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsarbiter.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsprimary.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rssecondary.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_slave.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_standalone.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/ls_timeout_standalone.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/not_ok_response.json6
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/standalone_removed.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/too_new.json2
-rw-r--r--src/mongo/client/sdam/json_tests/sdam_tests/single/too_old.json2
-rw-r--r--src/mongo/client/sdam/sdam_configuration.h2
-rw-r--r--src/mongo/client/sdam/sdam_configuration_parameters.idl4
-rw-r--r--src/mongo/client/sdam/sdam_json_test_runner.cpp14
-rw-r--r--src/mongo/client/sdam/server_description.cpp2
-rw-r--r--src/mongo/client/sdam/server_description_test.cpp6
-rw-r--r--src/mongo/client/sdam/server_selection_json_test_runner.cpp2
-rw-r--r--src/mongo/client/sdam/server_selector.cpp51
-rw-r--r--src/mongo/client/sdam/server_selector_test.cpp4
-rw-r--r--src/mongo/client/sdam/topology_listener_mock.cpp32
-rw-r--r--src/mongo/client/sdam/topology_listener_mock.h10
-rw-r--r--src/mongo/client/sdam/topology_manager_test.cpp2
-rw-r--r--src/mongo/client/sdam/topology_state_machine.cpp13
84 files changed, 212 insertions, 218 deletions
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/README.rst b/src/mongo/client/sdam/json_tests/sdam_tests/README.rst
index 3bc0127f057..f8bd43f8d4d 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/README.rst
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/README.rst
@@ -35,12 +35,12 @@ Each phase object has two keys:
A response is a pair of values:
- The source, for example "a:27017".
- This is the address the client sent the "hello" command to.
-- A "hello" response, for example `{ok: 1, isWritablePrimary: true}`.
+ This is the address the client sent the "ismaster" command to.
+- An ismaster response, for example `{ok: 1, ismaster: true}`.
If the response includes an electionId it is shown in extended JSON like
`{"$oid": "000000000000000000000002"}`.
The empty response `{}` indicates a network error
- when attempting to call "hello".
+ when attempting to call "ismaster".
In non-monitoring tests, an "outcome" represents the correct
TopologyDescription that results from processing the responses in the phases
@@ -67,10 +67,10 @@ current TopologyDescription. It has the following keys:
- maxWireVersion: absent or an integer.
In monitoring tests, an "outcome" contains a list of SDAM events that should
-have been published by the client as a result of processing "hello" responses
+have been published by the client as a result of processing ismaster responses
in the current phase. Any SDAM events published by the client during its
construction (that is, prior to processing any of the responses) should be
-combined with the events published during processing of "hello" responses
+combined with the events published during processing of ismaster responses
of the first phase of the test. A test MAY explicitly verify events published
during client construction by providing an empty responses array for the
first phase.
@@ -83,7 +83,7 @@ Mocking
~~~~~~~
Drivers should be able to test their server discovery and monitoring logic
-without any network I/O, by parsing "hello" responses from the test file
+without any network I/O, by parsing ismaster responses from the test file
and passing them into the driver code. Parts of the client and monitoring
code may need to be mocked or subclassed to achieve this. `A reference
implementation for PyMongo 3.x is available here
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible.json
index 2ff33116a40..0e2c68bf1f7 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible_unknown.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible_unknown.json
index 3ad398be5c4..878c1d8df54 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible_unknown.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/compatible_unknown.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_arbiters.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_arbiters.json
index f7931d6f484..98d72b5ccbe 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_arbiters.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_arbiters.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_passives.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_passives.json
index 58bc42e6b2f..5ee3b27478d 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_passives.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_passives.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
@@ -47,7 +47,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"passive": true,
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_primary.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_primary.json
index fe8464aad52..a8ff093cb8e 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_primary.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_primary.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_secondary.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_secondary.json
index 473ae8fd0e8..7210b3845c7 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_secondary.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discover_secondary.json
@@ -8,7 +8,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json
index 7d8a3777c23..f464134f12e 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
@@ -47,7 +47,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"primary": "d:27017",
@@ -91,7 +91,7 @@
"d:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"b:27017",
@@ -138,7 +138,7 @@
"c:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json.notused b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json.notused
index 4a489f68ab5..57ed568e3b0 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json.notused
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/discovery.json.notused
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
@@ -47,7 +47,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"primary": "d:27017",
@@ -91,7 +91,7 @@
"d:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"b:27017",
@@ -134,7 +134,7 @@
"c:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/equal_electionids.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/equal_electionids.json
index 0e8efc46cf7..f8d20b350df 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/equal_electionids.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/equal_electionids.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/ghost_discovered.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/ghost_discovered.json
index 994b69cece6..bf22cbb0eb5 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/ghost_discovered.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/ghost_discovered.json
@@ -8,7 +8,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"isreplicaset": true,
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/hosts_differ_from_seeds.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/hosts_differ_from_seeds.json
index 2d5b577cd67..4f2351cf05c 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/hosts_differ_from_seeds.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/hosts_differ_from_seeds.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_arbiter.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_arbiter.json
index 2aae7c37fe7..1d59b967c40 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_arbiter.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_arbiter.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_ghost.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_ghost.json
index 589671a1a75..193eea0c767 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_ghost.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_ghost.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_other.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_other.json
index dd485e0113b..93ba88e6617 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_other.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/incompatible_other.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/ls_timeout.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/ls_timeout.json
index 963f8801a54..0b0c2c6a885 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/ls_timeout.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/ls_timeout.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017",
@@ -57,7 +57,7 @@
"d:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"isreplicaset": true,
"setVersion": 1,
"electionId": {
@@ -98,7 +98,7 @@
"e:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"hosts": [
"a:27017",
"b:27017",
@@ -144,7 +144,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017",
@@ -192,7 +192,7 @@
"c:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"setName": "rs",
"hidden": true,
"logicalSessionTimeoutMinutes": 1,
@@ -234,7 +234,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_reconfig.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_reconfig.json
index f815374842d..9f970baccea 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_reconfig.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_reconfig.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -45,7 +45,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_standalone.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_standalone.json
index cb2eaec426c..bcd95719342 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_standalone.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/member_standalone.json
@@ -8,7 +8,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setVersion": 1,
"electionId": {
"$oid": "000000000000000000000001"
@@ -40,7 +40,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary.json
index 600dba83d3e..d22450decc7 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -45,7 +45,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_electionid.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_electionid.json
index 6c88dc2399f..67f314b1edc 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_electionid.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_electionid.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -54,7 +54,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -100,7 +100,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_setversion.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_setversion.json
index cebdf9ab4e2..c1ec50c845c 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_setversion.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_new_setversion.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -54,7 +54,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -100,7 +100,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_wrong_set_name.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_wrong_set_name.json
index 39977609075..9940b47b6e4 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_wrong_set_name.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/new_primary_wrong_set_name.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -45,7 +45,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case.json.disabled b/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case.json.disabled
index 6cfd75168fc..4d0b0ae629b 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case.json.disabled
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case.json.disabled
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"A:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case_me.json.disabled b/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case_me.json.disabled
index c89522275c1..e854e7fb432 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case_me.json.disabled
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/normalize_case_me.json.disabled
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"me": "A:27017",
"hosts": [
@@ -51,7 +51,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"me": "B:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/null_election_id.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/null_election_id.json
index 0f03c0b6c7f..3d6f7655576 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/null_election_id.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/null_election_id.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017",
@@ -52,7 +52,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017",
@@ -104,7 +104,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017",
@@ -154,7 +154,7 @@
"c:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_ghost.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_ghost.json
index 881b6cf07a2..6ff0ecc0b06 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_ghost.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_ghost.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
@@ -40,7 +40,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"isreplicaset": true,
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_mongos.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_mongos.json
index 18b3e3e4427..92acf6cca2f 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_mongos.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_mongos.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
@@ -40,7 +40,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"setVersion": 1,
"electionId": {
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_standalone.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_standalone.json
index 9bb846dcd6a..3e7144057ca 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_standalone.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_becomes_standalone.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_changes_set_name.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_changes_set_name.json
index 247cab35cc4..366df6e3500 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_changes_set_name.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_changes_set_name.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
@@ -40,7 +40,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect.json
index 627518d4c88..67c95de6b14 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_electionid.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_electionid.json
index a374e3e4fbb..59c8faf1805 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_electionid.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_electionid.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -101,7 +101,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -144,7 +144,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -190,7 +190,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_setversion.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_setversion.json
index f1e2c0097c1..beb023e4f41 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_setversion.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_disconnect_setversion.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -101,7 +101,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -144,7 +144,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -190,7 +190,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_hint_from_secondary_with_mismatched_me.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_hint_from_secondary_with_mismatched_me.json
index d516af6f715..bad86c8175d 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_hint_from_secondary_with_mismatched_me.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_hint_from_secondary_with_mismatched_me.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"me": "c:27017",
"hosts": [
@@ -39,7 +39,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"me": "b:27017",
"hosts": [
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_mismatched_me.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_mismatched_me.json
index 5259d2398e6..381edc7e4b1 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_mismatched_me.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_mismatched_me.json
@@ -26,7 +26,7 @@
"a:27017",
"b:27017"
],
- "isWritablePrimary": true,
+ "ismaster": true,
"ok": 1,
"setName": "rs",
"setVersion": 1,
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_reports_new_member.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_reports_new_member.json
index 65eedff59bd..4595bb93a78 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_reports_new_member.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_reports_new_member.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
@@ -42,7 +42,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -79,7 +79,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -121,7 +121,7 @@
"c:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"primary": "b:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_to_no_primary_mismatched_me.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_to_no_primary_mismatched_me.json
index e28a7211bb4..ade818740ac 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_to_no_primary_mismatched_me.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_to_no_primary_mismatched_me.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -46,7 +46,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"c:27017",
"d:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_wrong_set_name.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_wrong_set_name.json
index 2bb9523b9f5..c656ebf35d6 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_wrong_set_name.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/primary_wrong_set_name.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/response_from_removed.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/response_from_removed.json
index e0cb697d519..36e5d1e44f2 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/response_from_removed.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/response_from_removed.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017"
@@ -40,7 +40,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/rsother_discovered.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/rsother_discovered.json
index 2c90cdc7172..c575501d803 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/rsother_discovered.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/rsother_discovered.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hidden": true,
"hosts": [
@@ -24,7 +24,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": false,
"hosts": [
"c:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/sec_not_auth.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/sec_not_auth.json
index 99c3aa6622e..28fc85fc494 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/sec_not_auth.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/sec_not_auth.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_ignore_ok_0.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_ignore_ok_0.json
index 133aafdc406..4867b07844e 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_ignore_ok_0.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_ignore_ok_0.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_mismatched_me.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_mismatched_me.json
index 7df79c73c01..d2a70f67889 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_mismatched_me.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_mismatched_me.json
@@ -26,7 +26,7 @@
"a:27017",
"b:27017"
],
- "isWritablePrimary": false,
+ "ismaster": false,
"ok": 1,
"setName": "rs",
"minWireVersion": 0,
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name.json
index be621c06c83..4c132b633e1 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name_with_primary.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name_with_primary.json
index 3e7b1f83ed9..0bca723e5c3 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name_with_primary.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/secondary_wrong_set_name_with_primary.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -45,7 +45,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/set_version_can_rollback.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/set_version_can_rollback.json
index d90e097de75..d3fa9acb3c2 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/set_version_can_rollback.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/set_version_can_rollback.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -55,7 +55,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -102,7 +102,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/setversion_without_electionid.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/setversion_without_electionid.json
index c5c8107d0af..07ec55cee1c 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/setversion_without_electionid.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/setversion_without_electionid.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -46,7 +46,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/stepdown_change_set_name.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/stepdown_change_set_name.json
index ca6b0e77b45..fcf35ce5041 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/stepdown_change_set_name.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/stepdown_change_set_name.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017"
],
@@ -40,7 +40,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_new.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_new.json
index f2b65b843be..299b6fa9aab 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_new.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_new.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_old.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_old.json
index 0056594f943..e1ad154ba69 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_old.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/too_old.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"setName": "rs",
"hosts": [
"a:27017",
@@ -26,7 +26,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"setName": "rs",
"hosts": [
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/unexpected_mongos.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/unexpected_mongos.json
index b89547959d6..b9440de5805 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/unexpected_mongos.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/unexpected_mongos.json
@@ -8,7 +8,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"setVersion": 1,
"electionId": {
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/use_setversion_without_electionid.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/use_setversion_without_electionid.json
index 63635c9c419..365af2f7e19 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/use_setversion_without_electionid.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/use_setversion_without_electionid.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -54,7 +54,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
@@ -97,7 +97,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/rs/wrong_set_name.json b/src/mongo/client/sdam/json_tests/sdam_tests/rs/wrong_set_name.json
index cc4e3e963ce..45be2f502b2 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/rs/wrong_set_name.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/rs/wrong_set_name.json
@@ -8,7 +8,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"b:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/compatible.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/compatible.json
index 3f6df3e09e5..3dae1f7ea1e 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/compatible.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/compatible.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 1000
@@ -18,7 +18,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/ls_timeout_mongos.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/ls_timeout_mongos.json
index 7a46adee517..96f8dec17ac 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/ls_timeout_mongos.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/ls_timeout_mongos.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"logicalSessionTimeoutMinutes": 1,
"minWireVersion": 0,
@@ -19,7 +19,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"logicalSessionTimeoutMinutes": 2,
"minWireVersion": 0,
@@ -49,7 +49,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"logicalSessionTimeoutMinutes": 1,
"minWireVersion": 0,
@@ -60,7 +60,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/mongos_disconnect.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/mongos_disconnect.json
index f0f98648a78..04015694a8d 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/mongos_disconnect.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/mongos_disconnect.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
@@ -18,7 +18,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
@@ -70,7 +70,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/multiple_mongoses.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/multiple_mongoses.json
index 75398360994..6e60fd05c7d 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/multiple_mongoses.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/multiple_mongoses.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
@@ -18,7 +18,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/non_mongos_removed.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/non_mongos_removed.json
index 553c8debf74..7bf039d9bc8 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/non_mongos_removed.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/non_mongos_removed.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
@@ -18,7 +18,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"b:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_new.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_new.json
index b4f9f149516..9521e117899 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_new.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_new.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 999,
"maxWireVersion": 1000
@@ -18,7 +18,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid"
}
]
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_old.json b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_old.json
index 41ffed925d2..6bd187f61db 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_old.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/sharded/too_old.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 2,
"maxWireVersion": 6
@@ -18,7 +18,7 @@
"b:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid"
}
]
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/compatible.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/compatible.json
index 9c91ae1db1b..ee6b847ade7 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/compatible.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/compatible.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"minWireVersion": 0,
"maxWireVersion": 6
}
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_external_ip.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_external_ip.json
index f0b2cfe0a48..44581501862 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_external_ip.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_external_ip.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"b:27017"
],
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_mongos.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_mongos.json
index d1ec4ad53b5..a7fa0794901 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_mongos.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_mongos.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"msg": "isdbgrid",
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsarbiter.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsarbiter.json
index 461a032ac0c..3ef374d6f1e 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsarbiter.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsarbiter.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"arbiterOnly": true,
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsprimary.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsprimary.json
index 10d0b5452aa..bd5aaf7f044 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsprimary.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rsprimary.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"hosts": [
"a:27017",
"b:27017"
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rssecondary.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rssecondary.json
index 48595ac4d73..3b4f3c8c5ad 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rssecondary.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_rssecondary.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"secondary": true,
"hosts": [
"a:27017",
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_slave.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_slave.json
index 37bfa86fcf9..a40debd1838 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_slave.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_slave.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": false,
+ "ismaster": false,
"minWireVersion": 0,
"maxWireVersion": 6
}
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_standalone.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_standalone.json
index 373d4ebc9a9..2ecff9b9ae2 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_standalone.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/direct_connection_standalone.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"minWireVersion": 0,
"maxWireVersion": 6
}
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/ls_timeout_standalone.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/ls_timeout_standalone.json
index e48f6151f98..ae6c8ba11be 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/ls_timeout_standalone.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/ls_timeout_standalone.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"logicalSessionTimeoutMinutes": 7,
"minWireVersion": 0,
"maxWireVersion": 6
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/not_ok_response.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/not_ok_response.json
index c27ed1d9c4a..06f71305dc0 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/not_ok_response.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/not_ok_response.json
@@ -1,5 +1,5 @@
{
- "description": "Handle a not-ok isWritablePrimary response",
+ "description": "Handle a not-ok ismaster response",
"uri": "mongodb://a",
"phases": [
{
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"minWireVersion": 0,
"maxWireVersion": 6
}
@@ -17,7 +17,7 @@
"a:27017",
{
"ok": 0,
- "isWritablePrimary": true,
+ "ismaster": true,
"minWireVersion": 0,
"maxWireVersion": 6
}
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/standalone_removed.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/standalone_removed.json
index de6ffaa84dc..be1a73d30b8 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/standalone_removed.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/standalone_removed.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"minWireVersion": 0,
"maxWireVersion": 6
}
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/too_new.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/too_new.json
index 5320c4a2613..38e4621d60f 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/too_new.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/too_new.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true,
+ "ismaster": true,
"minWireVersion": 999,
"maxWireVersion": 1000
}
diff --git a/src/mongo/client/sdam/json_tests/sdam_tests/single/too_old.json b/src/mongo/client/sdam/json_tests/sdam_tests/single/too_old.json
index 55ef82acb71..fbf68262c02 100644
--- a/src/mongo/client/sdam/json_tests/sdam_tests/single/too_old.json
+++ b/src/mongo/client/sdam/json_tests/sdam_tests/single/too_old.json
@@ -8,7 +8,7 @@
"a:27017",
{
"ok": 1,
- "isWritablePrimary": true
+ "ismaster": true
}
]
],
diff --git a/src/mongo/client/sdam/sdam_configuration.h b/src/mongo/client/sdam/sdam_configuration.h
index 2a34b860ea7..f1b1122936c 100644
--- a/src/mongo/client/sdam/sdam_configuration.h
+++ b/src/mongo/client/sdam/sdam_configuration.h
@@ -90,7 +90,7 @@ public:
const boost::optional<std::string>& getSetName() const;
/**
- * The frequency at which we measure RTT and "hello" responses.
+ * The frequency at which we measure RTT and IsMaster responses.
*/
Milliseconds getHeartBeatFrequency() const;
diff --git a/src/mongo/client/sdam/sdam_configuration_parameters.idl b/src/mongo/client/sdam/sdam_configuration_parameters.idl
index 851cfa307d3..f36a6d9144b 100644
--- a/src/mongo/client/sdam/sdam_configuration_parameters.idl
+++ b/src/mongo/client/sdam/sdam_configuration_parameters.idl
@@ -32,9 +32,7 @@ global:
server_parameters:
heartBeatFrequencyMs:
- description: "For the 'sdam' replicaSetMonitorProtocol, determines how long to wait between
- 'hello' requests. For the 'streamable' replicaSetMonitorProtocol, duration between rtt
- measurements."
+ description: For the 'sdam' replicaSetMonitorProtocol, determines how long to wait between isMaster requests. For the 'streamable' replicaSetMonitorProtocol, duration between rtt measurements.
set_at: startup
cpp_vartype: int
cpp_varname: sdamHeartBeatFrequencyMs
diff --git a/src/mongo/client/sdam/sdam_json_test_runner.cpp b/src/mongo/client/sdam/sdam_json_test_runner.cpp
index 431d281a8f7..b3fdcba09f0 100644
--- a/src/mongo/client/sdam/sdam_json_test_runner.cpp
+++ b/src/mongo/client/sdam/sdam_json_test_runner.cpp
@@ -82,13 +82,13 @@ public:
for (auto& response : bsonResponses) {
const auto pair = response.Array();
const auto address = HostAndPort(pair[0].String());
- const auto bsonHello = pair[1].Obj();
+ const auto bsonIsMaster = pair[1].Obj();
- if (bsonHello.nFields() == 0) {
- _helloResponses.push_back(HelloOutcome(address, BSONObj(), "network error"));
+ if (bsonIsMaster.nFields() == 0) {
+ _isMasterResponses.push_back(HelloOutcome(address, BSONObj(), "network error"));
} else {
- _helloResponses.push_back(
- HelloOutcome(address, bsonHello, duration_cast<HelloRTT>(kLatency)));
+ _isMasterResponses.push_back(
+ HelloOutcome(address, bsonIsMaster, duration_cast<HelloRTT>(kLatency)));
}
}
_topologyOutcome = phase["outcome"].Obj();
@@ -109,7 +109,7 @@ public:
PhaseResult execute(TopologyManager& topology) const {
PhaseResult testResult{{}, _phaseNum};
- for (auto response : _helloResponses) {
+ for (auto response : _isMasterResponses) {
auto descriptionStr =
(response.getResponse()) ? response.getResponse()->toString() : "[ Network Error ]";
LOGV2(20202,
@@ -418,7 +418,7 @@ private:
MongoURI _testUri;
int _phaseNum;
- std::vector<HelloOutcome> _helloResponses;
+ std::vector<HelloOutcome> _isMasterResponses;
BSONObj _topologyOutcome;
};
diff --git a/src/mongo/client/sdam/server_description.cpp b/src/mongo/client/sdam/server_description.cpp
index a3e8b7f0899..babe5d1a777 100644
--- a/src/mongo/client/sdam/server_description.cpp
+++ b/src/mongo/client/sdam/server_description.cpp
@@ -209,7 +209,7 @@ void ServerDescription::parseTypeFromHelloReply(const BSONObj helloReply) {
t = ServerType::kMongos;
} else if (hasSetName && helloReply.getBoolField("hidden")) {
t = ServerType::kRSOther;
- } else if (hasSetName && helloReply.getBoolField("isWritablePrimary")) {
+ } else if (hasSetName && helloReply.getBoolField("ismaster")) {
t = ServerType::kRSPrimary;
} else if (hasSetName && helloReply.getBoolField("secondary")) {
t = ServerType::kRSSecondary;
diff --git a/src/mongo/client/sdam/server_description_test.cpp b/src/mongo/client/sdam/server_description_test.cpp
index 9ca83dd1c63..b4cbc940c28 100644
--- a/src/mongo/client/sdam/server_description_test.cpp
+++ b/src/mongo/client/sdam/server_description_test.cpp
@@ -241,7 +241,7 @@ protected:
static inline const auto kBsonMissingOk = BSONObjBuilder().obj();
static inline const auto kBsonMongos = okBuilder().append("msg", "isdbgrid").obj();
static inline const auto kBsonRsPrimary =
- okBuilder().append("isWritablePrimary", true).append("setName", "foo").obj();
+ okBuilder().append("ismaster", true).append("setName", "foo").obj();
static inline const auto kBsonRsSecondary =
okBuilder().append("secondary", true).append("setName", "foo").obj();
static inline const auto kBsonRsArbiter =
@@ -289,7 +289,7 @@ protected:
okBuilder().append("topologyVersion", TopologyVersion(OID::max(), 0).toBSON()).obj();
};
-TEST_F(ServerDescriptionTestFixture, ShouldParseTypeAsUnknownForHelloError) {
+TEST_F(ServerDescriptionTestFixture, ShouldParseTypeAsUnknownForIsMasterError) {
auto response = HelloOutcome(HostAndPort("foo:1234"), kTopologyVersion, "an error occurred");
auto description = ServerDescription(clockSource, response);
ASSERT_EQUALS(ServerType::kUnknown, description.getType());
@@ -316,7 +316,7 @@ TEST_F(ServerDescriptionTestFixture, ShouldParseTypeAsMongos) {
}
TEST_F(ServerDescriptionTestFixture, ShouldParseTypeAsRSPrimary) {
- // "isWritablePrimary: true", "setName" in response
+ // "ismaster: true", "setName" in response
auto response = HelloOutcome(HostAndPort("foo:1234"), kBsonRsPrimary, HelloRTT::min());
auto description = ServerDescription(clockSource, response);
ASSERT_EQUALS(ServerType::kRSPrimary, description.getType());
diff --git a/src/mongo/client/sdam/server_selection_json_test_runner.cpp b/src/mongo/client/sdam/server_selection_json_test_runner.cpp
index 051cc4d9d8e..5da205b53e1 100644
--- a/src/mongo/client/sdam/server_selection_json_test_runner.cpp
+++ b/src/mongo/client/sdam/server_selection_json_test_runner.cpp
@@ -130,7 +130,7 @@ public:
HelloOutcome(HostAndPort("dummy"),
BSON("ok" << 1 << "setname"
<< "replSet"
- << "isWritablePrimary" << true),
+ << "ismaster" << true),
HelloRTT(Milliseconds(_newRtt)))));
}
diff --git a/src/mongo/client/sdam/server_selector.cpp b/src/mongo/client/sdam/server_selector.cpp
index 76d08324f03..5dd58d95684 100644
--- a/src/mongo/client/sdam/server_selector.cpp
+++ b/src/mongo/client/sdam/server_selector.cpp
@@ -230,40 +230,35 @@ bool SdamServerSelector::_containsAllTags(ServerDescriptionPtr server, const BSO
void SdamServerSelector::filterTags(std::vector<ServerDescriptionPtr>* servers,
const TagSet& tagSet) {
- const auto& tagSetList = tagSet.getTagBSON();
+ const auto& checkTags = tagSet.getTagBSON();
- if (tagSetList.isEmpty()) {
+ if (checkTags.nFields() == 0)
return;
- }
- for (const auto& tagSetElem : tagSetList) {
- if (tagSetElem.type() != BSONType::Object) {
- LOGV2_WARNING(4671202,
- "Invalid tag set specified for server selection; tag sets should be"
- " specified as a BSON object",
- "tag"_attr = tagSetElem);
- continue;
+ const auto predicate = [&](const ServerDescriptionPtr& s) {
+ auto it = checkTags.begin();
+ while (it != checkTags.end()) {
+ if (it->isABSONObj()) {
+ const BSONObj& tags = it->Obj();
+ if (_containsAllTags(s, tags)) {
+ // found a match -- don't remove the server
+ return false;
+ }
+ } else {
+ LOGV2_WARNING(
+ 4671202,
+ "Invalid tags specified for server selection; tags should be specified as "
+ "bson Objects",
+ "tag"_attr = *it);
+ }
+ ++it;
}
- const auto predicate = [&](const ServerDescriptionPtr& s) {
- const bool shouldRemove = !_containsAllTags(s, tagSetElem.embeddedObject());
- return shouldRemove;
- };
-
- auto it = std::remove_if(servers->begin(), servers->end(), predicate);
- // If none of the server descriptions match the tag set, then continue on to check the next
- // tag set in the list. Otherwise, if at least one of the server descriptions match the tag
- // set criteria, then we've found our preferred host(s) to read from.
- if (it != servers->begin()) {
- servers->erase(it, servers->end());
- return;
- }
- }
+ // remove the server
+ return true;
+ };
- // Getting here means a non-empty tag set list was specified but none of the server descriptions
- // matched any of the tag sets in the list. We've therefore failed to find any server
- // description matching the read preference tag criteria.
- servers->clear();
+ servers->erase(std::remove_if(servers->begin(), servers->end(), predicate), servers->end());
}
bool SdamServerSelector::recencyFilter(const ReadPreferenceSetting& readPref,
diff --git a/src/mongo/client/sdam/server_selector_test.cpp b/src/mongo/client/sdam/server_selector_test.cpp
index 7d2a3ee79a3..f9d67676e2c 100644
--- a/src/mongo/client/sdam/server_selector_test.cpp
+++ b/src/mongo/client/sdam/server_selector_test.cpp
@@ -656,9 +656,7 @@ TEST_F(ServerSelectorTestFixture, ShouldFilterByTags) {
tags = TagSets::eastOrWestProductionSet;
servers = makeServerDescriptionList();
selector.filterTags(&servers, tags);
- ASSERT_EQ(1, servers.size());
- ASSERT((std::map<std::string, std::string>{{"dc", "east"}, {"usage", "production"}}) ==
- servers[0]->getTags());
+ ASSERT_EQ(2, servers.size());
tags = TagSets::testSet;
servers = makeServerDescriptionList();
diff --git a/src/mongo/client/sdam/topology_listener_mock.cpp b/src/mongo/client/sdam/topology_listener_mock.cpp
index d6cd0ceb6c8..fb306d9158d 100644
--- a/src/mongo/client/sdam/topology_listener_mock.cpp
+++ b/src/mongo/client/sdam/topology_listener_mock.cpp
@@ -35,11 +35,11 @@ namespace mongo::sdam {
void TopologyListenerMock::onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort,
const BSONObj reply) {
stdx::lock_guard lk(_mutex);
- auto it = _serverHelloReplies.find(hostAndPort);
- if (it != _serverHelloReplies.end()) {
+ auto it = _serverIsMasterReplies.find(hostAndPort);
+ if (it != _serverIsMasterReplies.end()) {
it->second.emplace_back(Status::OK());
} else {
- _serverHelloReplies.emplace(hostAndPort, std::vector<Status>{Status::OK()});
+ _serverIsMasterReplies.emplace(hostAndPort, std::vector<Status>{Status::OK()});
}
}
@@ -49,30 +49,30 @@ void TopologyListenerMock::onServerHeartbeatFailureEvent(Status errorStatus,
stdx::lock_guard lk(_mutex);
// If the map already contains an element for hostAndPort, append to its already existing
// vector. Otherwise, create a new vector.
- auto it = _serverHelloReplies.find(hostAndPort);
- if (it != _serverHelloReplies.end()) {
+ auto it = _serverIsMasterReplies.find(hostAndPort);
+ if (it != _serverIsMasterReplies.end()) {
it->second.emplace_back(errorStatus);
} else {
- _serverHelloReplies.emplace(hostAndPort, std::vector<Status>{errorStatus});
+ _serverIsMasterReplies.emplace(hostAndPort, std::vector<Status>{errorStatus});
}
}
-bool TopologyListenerMock::hasHelloResponse(const HostAndPort& hostAndPort) {
+bool TopologyListenerMock::hasIsMasterResponse(const HostAndPort& hostAndPort) {
stdx::lock_guard lock(_mutex);
- return _hasHelloResponse(lock, hostAndPort);
+ return _hasIsMasterResponse(lock, hostAndPort);
}
-bool TopologyListenerMock::_hasHelloResponse(WithLock, const HostAndPort& hostAndPort) {
- return _serverHelloReplies.find(hostAndPort) != _serverHelloReplies.end();
+bool TopologyListenerMock::_hasIsMasterResponse(WithLock, const HostAndPort& hostAndPort) {
+ return _serverIsMasterReplies.find(hostAndPort) != _serverIsMasterReplies.end();
}
-std::vector<Status> TopologyListenerMock::getHelloResponse(const HostAndPort& hostAndPort) {
+std::vector<Status> TopologyListenerMock::getIsMasterResponse(const HostAndPort& hostAndPort) {
stdx::lock_guard lock(_mutex);
- invariant(_hasHelloResponse(lock, hostAndPort));
- auto it = _serverHelloReplies.find(hostAndPort);
- auto statusWithHelloResponse = it->second;
- _serverHelloReplies.erase(it);
- return statusWithHelloResponse;
+ invariant(_hasIsMasterResponse(lock, hostAndPort));
+ auto it = _serverIsMasterReplies.find(hostAndPort);
+ auto statusWithIsMasterResponse = it->second;
+ _serverIsMasterReplies.erase(it);
+ return statusWithIsMasterResponse;
}
void TopologyListenerMock::onServerPingSucceededEvent(HelloRTT latency,
diff --git a/src/mongo/client/sdam/topology_listener_mock.h b/src/mongo/client/sdam/topology_listener_mock.h
index d8f99eb5a88..ad8db6f46da 100644
--- a/src/mongo/client/sdam/topology_listener_mock.h
+++ b/src/mongo/client/sdam/topology_listener_mock.h
@@ -47,15 +47,15 @@ public:
BSONObj reply) override;
/**
- * Returns true if _serverHelloReplies contains an element corresponding to hostAndPort.
+ * Returns true if _serverIsMasterReplies contains an element corresponding to hostAndPort.
*/
- bool hasHelloResponse(const HostAndPort& hostAndPort);
- bool _hasHelloResponse(WithLock, const HostAndPort& hostAndPort);
+ bool hasIsMasterResponse(const HostAndPort& hostAndPort);
+ bool _hasIsMasterResponse(WithLock, const HostAndPort& hostAndPort);
/**
* Returns the responses for the most recent onServerHeartbeat events.
*/
- std::vector<Status> getHelloResponse(const HostAndPort& hostAndPort);
+ std::vector<Status> getIsMasterResponse(const HostAndPort& hostAndPort);
void onServerPingSucceededEvent(HelloRTT latency, const HostAndPort& hostAndPort) override;
@@ -74,7 +74,7 @@ public:
private:
Mutex _mutex;
- stdx::unordered_map<HostAndPort, std::vector<Status>> _serverHelloReplies;
+ stdx::unordered_map<HostAndPort, std::vector<Status>> _serverIsMasterReplies;
stdx::unordered_map<HostAndPort, std::vector<StatusWith<HelloRTT>>> _serverPingRTTs;
};
diff --git a/src/mongo/client/sdam/topology_manager_test.cpp b/src/mongo/client/sdam/topology_manager_test.cpp
index 0c67a25fb59..8c3b45fef38 100644
--- a/src/mongo/client/sdam/topology_manager_test.cpp
+++ b/src/mongo/client/sdam/topology_manager_test.cpp
@@ -60,7 +60,7 @@ protected:
static inline const auto kBsonTopologyVersionHigh =
okBuilder().append("topologyVersion", TopologyVersion(OID::max(), 1).toBSON()).obj();
static inline const auto kBsonRsPrimary = okBuilder()
- .append("isWritablePrimary", true)
+ .append("ismaster", true)
.append("setName", kSetName)
.append("minWireVersion", 2)
.append("maxWireVersion", 10)
diff --git a/src/mongo/client/sdam/topology_state_machine.cpp b/src/mongo/client/sdam/topology_state_machine.cpp
index 8ff6c8a9848..5c8cb94c954 100644
--- a/src/mongo/client/sdam/topology_state_machine.cpp
+++ b/src/mongo/client/sdam/topology_state_machine.cpp
@@ -154,11 +154,14 @@ void TopologyStateMachine::onServerDescription(TopologyDescription& topologyDesc
const ServerDescriptionPtr& serverDescription) {
if (!topologyDescription.containsServerAddress(serverDescription->getAddress())) {
const auto& setName = topologyDescription.getSetName();
- LOGV2_DEBUG(20219,
- kLogLevel,
- "Ignoring 'hello' reply from server that is not in the topology",
- "replicaSet"_attr = setName ? *setName : std::string(""),
- "serverAddress"_attr = serverDescription->getAddress());
+ LOGV2_DEBUG(
+ 20219,
+ kLogLevel,
+ "{replSetName}: Ignoring isMaster reply from server that is not in the topology: "
+ "{serverAddress}",
+ "Ignoring isMaster reply from server that is not in the topology",
+ "replicaSet"_attr = setName ? *setName : std::string(""),
+ "serverAddress"_attr = serverDescription->getAddress());
return;
}