[DRIVERS-1999] Add server selection spec test to ensure that RSGhost servers are not selectable Created: 01/Dec/21  Updated: 20/May/22

Status: Implementing
Project: Drivers
Component/s: Server Selection
Fix Version/s: None

Type: Task Priority: Unknown
Reporter: Shane Harvey Assignee: Shane Harvey
Resolution: Unresolved Votes: 0
Labels: yaml-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to PYTHON-3027 Connecting to a replica set member in... Closed
split to CDRIVER-4236 Add server selection spec test to ens... Backlog
split to CSHARP-3983 Add server selection spec test to ens... Backlog
split to CXX-2418 Add server selection spec test to ens... Backlog
split to GODRIVER-2250 Add server selection spec test to ens... Backlog
split to RUST-1121 Add server selection spec test to ens... Backlog
split to NODE-3797 Add server selection spec test to ens... Closed
split to MOTOR-863 Add server selection spec test to ens... Closed
split to PHPLIB-769 Add server selection spec test to ens... Closed
split to RUBY-2850 Add server selection spec test to ens... Closed
split to JAVA-4420 Add server selection spec test to ens... Closed
Driver Changes: Needed
Downstream Changes Summary:

Teams should resync the server selection spec tests to pull in the new test added in: https://github.com/mongodb/specifications/commit/537bb198d79d5695e735ad127ec3807689b859dd

Note that in pymongo (PYTHON-3027) I needed to update the test runner to handle the RSGhost server type. Other drivers may need to do the same:

diff --git a/test/utils_selection_tests.py b/test/utils_selection_tests.py
index 0006f6f6..de10312c 100644
--- a/test/utils_selection_tests.py
+++ b/test/utils_selection_tests.py
@@ -63,7 +63,7 @@ def make_server_description(server, hosts):
         return ServerDescription(clean_node(server['address']), Hello({}))
 
     hello_response = {'ok': True, 'hosts': hosts}
-    if server_type != "Standalone" and server_type != "Mongos":
+    if server_type not in ("Standalone", "Mongos", "RSGhost", "RSGhost"):
         hello_response['setName'] = "rs"
 
     if server_type == "RSPrimary":
@@ -72,6 +72,8 @@ def make_server_description(server, hosts):
         hello_response['secondary'] = True
     elif server_type == "Mongos":
         hello_response['msg'] = 'isdbgrid'
+    elif server_type == "RSGhost":
+        hello_response['isreplicaset'] = True
 
     hello_response['lastWrite'] = {
         'lastWriteDate': make_last_write_date(server)

Driver Compliance:
Key Status/Resolution FixVersion
PYTHON-3027 Fixed 4.0.1
CDRIVER-4236 Backlog
CXX-2418 Backlog
CSHARP-3983 Backlog
GODRIVER-2250 Backlog
JAVA-4420 Fixed 4.5.0
NODE-3797 Fixed 4.4.0
PHPLIB-769 Won't Do
MOTOR-863 Duplicate
RUBY-2850 Fixed 2.18.0
RUST-1121 Backlog
SWIFT-1428 Duplicate

 Description   

When a client starts up and initially discovers a RSGhost node, the SDAM spec says that the topology type must remain Unknown. PyMongo recently had a bug where the RSGhost node would be selectable in this scenario (PYTHON-3027). We should add server selection spec tests to ensure that RSGhost servers are not selectable.



 Comments   
Comment by Githook User [ 02/Dec/21 ]

Author:

{'name': 'Shane Harvey', 'email': 'shane.harvey@mongodb.com', 'username': 'ShaneHarvey'}

Message: DRIVERS-1999 Add server selection spec test to ensure that RSGhost servers are not selectable (#1106)
Branch: master
https://github.com/mongodb/specifications/commit/537bb198d79d5695e735ad127ec3807689b859dd

Comment by Shane Harvey [ 01/Dec/21 ]

PR: https://github.com/mongodb/specifications/pull/1106

Generated at Thu Feb 08 08:24:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.