Skip to content

DRIVERS-3720 Pin only the mongodb-runner config server to the IPv4 loopback - #933

Merged
blink1073 merged 1 commit into
mongodb-labs:masterfrom
blink1073:det-localthost-bug
Nov 10, 2026
Merged

blink1073 merged 1 commit into
mongodb-labs:masterfrom
blink1073:det-localthost-bug

Conversation

@blink1073

@blink1073 blink1073 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

DRIVERS-3720

Summary

mongodb-runner 8.4.5 applies the configured host to the config server, so a dual-stack mongos pins ::1 for --configdb against an IPv4-only config server and start never returns (DRIVERS-3720). PR #922 pinned every server to 127.0.0.1, breaking driver tests that assume the loopback name (CDRIVER-6558, with the same fallout in C# and Rust).

Changes in this PR

  • Restores localhost as the advertised host for every topology.
  • Pins only the sharded config server to 127.0.0.1 (the pre-8.4.5 carve-out).
  • Asserts the rendered MONGODB_URI advertises localhost.

Test Plan

  • Unit: python -m unittest test_drivers_orchestration passes 28/28, including two new tests for the host config.
  • Live on a ::1-first host: sharded start returns in ~22s; the naive localhost revert hangs and the DRIVERS-3673 Fix mongodb-runner dropping mongod server logs after startup #922 pin advertises 127.0.0.1.
  • C driver /TOPOLOGY/reconcile/from_handshake: fails against a 127.0.0.1 deployment, passes against localhost.

Checklist

Checklist for Author

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

@blink1073 blink1073 changed the title [DRIVERS-3720]: Pin only the mongodb-runner config server to the IPv4 loopback DRIVERS-3720 Pin only the mongodb-runner config server to the IPv4 loopback Nov 10, 2026
@blink1073
blink1073 requested a balanced review from Copilot November 10, 2026 19:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for restoring localhost defaults while retaining the config-server-specific IPv4 override.

No open issues 🎉

What changed in this PR

Restores localhost for driver-facing deployments while retaining the config-server-only IPv4 workaround that prevents sharded startup hangs. This addresses the driver-test regressions introduced by PR #922’s global IPv4 pin.

Changes:

  • Uses localhost by default, overriding only the sharded config server to 127.0.0.1.
  • Updates unit tests to verify the default host and config-server override.
  • Adds integration assertions that rendered connection strings advertise localhost, not 127.0.0.1.
File Description
.evergreen/​tests/​test-mongodb-runner.sh Checks advertised hosts in rendered connection strings.
.evergreen/​orchestration/​test_drivers_orchestration.py Verifies default and config-server-specific host settings.
.evergreen/​orchestration/​mongodb_runner.py Limits the IPv4 pin to the sharded config server.

Review effort: Balanced

@blink1073
blink1073 marked this pull request as ready for review November 10, 2026 19:33
@blink1073
blink1073 requested a review from a team as a code owner November 10, 2026 19:33
# mongos pins the first address "localhost" resolves to (::1 here),
# which an IPv4-only config server does not listen on, so start
# hangs (DRIVERS-3720). Shard 0 is always the config server; drop
# the pin once fixed upstream.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there an upstream issue we can link here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

DRIVERS-3720 is the tracking issue, this PR is a workaround

@PavelSafronov PavelSafronov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

@blink1073
blink1073 merged commit 1755ce6 into mongodb-labs:master Nov 10, 2026
88 of 91 checks passed
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