[SERVER-46430] myPort() shell helper does not respect replicaset strings Created: 26/Feb/20  Updated: 29/Oct/23  Resolved: 27/Feb/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.4

Type: Bug Priority: Major - P3
Reporter: Sara Golemon Assignee: Sara Golemon
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2020-03-09
Participants:
Linked BF Score: 48

 Description   

Shell helper `myPort()` assumes a single host:port from `getMongo().host`, however this may be a replicaset string under certain CI suites.   Split the string on commas first and use the host from the first member.

https://github.com/mongodb/mongo/blob/86e9d861dd056cdd71ff191ad032cc392bf9071a/src/mongo/shell/servers.js#L1435

 

 



 Comments   
Comment by Githook User [ 27/Feb/20 ]

Author:

{'name': 'Sara Golemon', 'username': 'sgolemon', 'email': 'sara.golemon@mongodb.com'}

Message: SERVER-46430 Improve myPort() shell helper to parse IPv6 and replica sets
Branch: master
https://github.com/mongodb/mongo/commit/580db10d838d7d550ea4ec4d1b2ffdad097276f7

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