Skip to content

Improve selection criteria for srvMaxHosts#1590

Merged
joykim1005 merged 9 commits intomongodb:mainfrom
joykim1005:JAVA-4400
Jan 16, 2025
Merged

Improve selection criteria for srvMaxHosts#1590
joykim1005 merged 9 commits intomongodb:mainfrom
joykim1005:JAVA-4400

Conversation

@joykim1005
Copy link
Copy Markdown
Contributor

@joykim1005 joykim1005 commented Dec 31, 2024

Ticket

JAVA-4400

Description

This PR improves the selection criteria for srvMaxHosts. The net result is that it will keep existing nodes, discard deleted nodes, and fill up to srvMaxHosts from a random shuffle of newly discovered nodes from the SRV response. It also updates the prose test to match the spec.

Testing

@joykim1005 joykim1005 requested review from a team and stIncMale and removed request for a team January 6, 2025 14:20
@joykim1005 joykim1005 marked this pull request as ready for review January 7, 2025 15:36
@joykim1005 joykim1005 requested a review from katcharov January 7, 2025 18:38
@jyemin jyemin removed the request for review from stIncMale January 7, 2025 22:17
@jyemin
Copy link
Copy Markdown
Collaborator

jyemin commented Jan 7, 2025

I removed @stIncMale since he is currently overloaded. @katcharov please let me know if you think a second reviewer is needed for this.

Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
@joykim1005 joykim1005 requested a review from katcharov January 14, 2025 18:05
Copy link
Copy Markdown
Collaborator

@katcharov katcharov left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of minor optional comments

Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
Comment thread driver-core/src/main/com/mongodb/internal/connection/DnsMultiServerCluster.java Outdated
@joykim1005 joykim1005 merged commit 0922a24 into mongodb:main Jan 16, 2025
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