Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRIVERS-3128 test secondary with IPv6 literal in SDAM #1766

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

kevinAlbs
Copy link
Contributor

Summary

Add regression test for the bug identified in this comment of HELP-68823.

Motivation

Test is added to spec repo to validate other drivers handle IPv6 literals correctly. The tested scenario is:

  • Connect with: mongodb://[::1]:27017/?replicaSet=rs
  • Server responds as a secondary (putting the driver's topology state in ReplicaSetNoPrimary) and a "me":"[::1]:27017.
  • Expect the server to be present. The bug from HELP-68823 triggered the server to be (unexpectedly) removed from the topology due to the mismatched me check.

Testing

Tested in mongodb/mongo-rust-driver#1327.

Fails on mongodb/mongo-rust-driver@206b99e (before fix)

$ cargo nextest run -- sdam::description::topology::test::sdam::rs
[...]
thread 'sdam::description::topology::test::sdam::rs' panicked at src/sdam/description/topology/test/sdam.rs:441:5:
assertion `left == right` failed: Secondary with IPv6 literal: 0
  left: 0
 right: 1

Passes on mongodb/mongo-rust-driver@1acffc4 (after fix).


Please complete the following before merging:

  • [ ] Update changelog. (Tests only)
  • Test changes in at least one language driver. (Tested in Rust)
  • [ ] Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).
    (N/A. Test mocks data to SDAM)

@kevinAlbs kevinAlbs marked this pull request as ready for review March 7, 2025 18:51
@kevinAlbs kevinAlbs requested a review from a team as a code owner March 7, 2025 18:51
@kevinAlbs kevinAlbs requested review from W-A-James and abr-egn and removed request for a team and W-A-James March 7, 2025 18:51
@kevinAlbs kevinAlbs merged commit fc495d5 into mongodb:master Mar 7, 2025
5 checks passed
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants