[GODRIVER-2292] Update load balancer tests to support dedicated load balancer port Created: 31/Jan/22  Updated: 13/Apr/22  Resolved: 17/Feb/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: PM Bot Assignee: Matt Dale
Resolution: Done Votes: 0
Labels: greenerbuild
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-2276 Require hello command + OP_MSG when '... Closed
Issue split
split from DRIVERS-1983 Update load balancer tests to support... Implementing
Related
related to DRIVERS-2224 Update initial DNS seedlist discovery... Blocked
related to GODRIVER-2312 Unskip "initial-dns-seedlist-discover... Closed
Server Compat: 5.0, 5.2
Quarter: FY23Q1
Upstream Changes Summary:

DRIVERS-1983:
Implementation notes for drivers:

  • Drivers must update their load balancer test runs in Evergreen to run on "latest", and then may choose to use 5.2.0 GA and higher for the runs when available.
  • Drivers must remove the use of service ID mocking (e.g. FAKE_MONGODB_SERVICE_ID) in their code.
  • Drivers must set the LOAD_BALANCER environment variable to "true" in their load balancer test runs and pass the environment variable when invoking run-orchestration.sh.
  • Drivers may need to make changes to their test runners if they had direct connections to the mongos in their tests with the "loadBalanced=true" URI option set. (Such as utility clients - they must go through the load balancer now in these cases.)

See: https://github.com/mongodb-labs/drivers-evergreen-tools/pull/183
See: https://github.com/mongodb/node-mongodb-native/pull/3089


 Description   

This ticket was split from DRIVERS-1983, please see that ticket for a detailed description.



 Comments   
Comment by Githook User [ 01/Mar/22 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2292 Support dedicated load balancer port in tests. (#852)
Branch: cloud-1.7.1
https://github.com/mongodb/mongo-go-driver/commit/e4487b407af5980c5f49cd288b3bb70d060b21d6

Comment by Githook User [ 01/Mar/22 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2292 Support dedicated load balancer port in tests. (#852)
Branch: release/1.8
https://github.com/mongodb/mongo-go-driver/commit/744f96b9409e226d66222a3fa65e1d04273fec5d

Comment by Matt Dale [ 17/Feb/22 ]

Fixing these tests actually required fixing:

  1. The Go driver config and code: https://github.com/mongodb/mongo-go-driver/pull/852
  2. The mongo-orchestration scripts: https://github.com/mongodb-labs/drivers-evergreen-tools/pull/186
  3. The DNS SRV records for the initial DNS seedlist spec tests (in-progress): https://jira.mongodb.org/browse/BUILD-14668
  4. The initial DNS seedlist spec tests (in-progress): https://github.com/mongodb/specifications/pull/1148

The load balancer tests pass now (tests impacted by in-progress DNS/spec updates are currently skipped and will be fixed with GODRIVER-2312), so I'm calling this done.

Comment by Githook User [ 17/Feb/22 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2292 Support dedicated load balancer port in tests. (#852)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/a2556956b42eca51370000e1fd94f77a8a5de0c8

Comment by Matt Dale [ 15/Feb/22 ]

The requirement

Drivers must remove the use of service ID mocking (e.g. FAKE_MONGODB_SERVICE_ID) in their code.

seems incompatible with the current setup of the initial-dns-seedlist-discovery spec tests.

The initial-dns-seedlist-discovery spec tests currently require resolving a mongodb+srv:// scheme URI to a list of hostports, all of which point directly to a local mongos instance (localhost:27017 or localhost:27018). However, to get the new behavior behavior where the server returns a serviceID, the driver needs to connect to the HAProxy hostport (localhost:8000 or localhost:8001 if using run-load-balancer.sh from drivers-evergreen-tools). As a result, the initial-dns-seedlist-discovery spec tests fail because the server doesn't return a seriviceID in the "hello" response description, leading to driver errors because the server doesn't appear to be load-balanced but the driver is configured in load-balancer mode.

Previously the Go driver "mocked" the service ID when running a test with "?loadBalanced=true" in the URI. Now that the "mocking" is removed, the tests fail because the server doesn't return a serviceID in "hello" responses if you connect directly to the mongos.

Possible fixes:
1. Mock serviceID only for initial-dns-seedlist-discovery tests.
2. Update run-load-balancer.sh and run-orchestration.sh configurations to make HAProxy listen on port 27017 or 27018 and mongos listen on different ports.
3. Update the DNS entries that are used for the load-balanced initial-dns-seedlist-discovery spec tests to return SRV records pointing to ports 8000,8001 instead of 27017,27018.

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