[SERVER-25284] Include resolved IP address in rs.status() Created: 26/Jul/16  Updated: 27/Dec/19  Resolved: 19/Apr/19

Status: Closed
Project: Core Server
Component/s: Diagnostics, Replication
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Improvement Priority: Minor - P4
Reporter: Shakir Sadikali Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: SWDI, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-12658 Docs for SERVER-25284: Include resolv... Closed
Related
related to SERVER-45270 Increased vulnerability to slow DNS Closed
is related to SERVER-45304 Include resolved IP address in rs.sta... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2019-04-22
Participants:

 Description   

Original title: Include resolved IP address in rs.status() and rs.conf()

We often have to troubleshoot replication issues. It would be handy to include the IP address the DNS entry resolves to (from the MongoDB perspective) to help with diagnostics.

For example

2016-07-25T09:02:19.834-0400 I NETWORK  [ReplExecNetThread-49255] Socket closed remotely, no longer connected (idle 6 secs, remote host 10.71.219.130:27017)
2016-07-25T09:02:19.879-0400 W NETWORK  [ReplExecNetThread-49255] Failed to connect to 10.71.219.130:27017, reason: errno:111 Connection refused

I'd like to more easily associate these with a node. Alternatively, perhaps include the host in the logging? Or both?



 Comments   
Comment by Lingzhi Deng [ 27/Dec/19 ]

Reverted in 4.2.3

Comment by Githook User [ 27/Dec/19 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: Revert 'SERVER-25284 Show IPs in rs.status()'

This reverts commit e1e95afbd58a7449dd1765cb910b4d136f95fcc4.
Branch: v4.2
https://github.com/mongodb/mongo/commit/271d73eb1b7acfb5ed601c3219a65dcbf06a1f27

Comment by Ravind Kumar (Inactive) [ 27/Dec/19 ]

lingzhi.deng what version was this reverted in? this server ticket was merged in before GA, so I'm assuming the docs are true for specific point versions of 4.2.x.

Comment by Lingzhi Deng [ 26/Dec/19 ]

Since this was reverted, I "re-opened" this ticket as SERVER-45304.

Comment by Githook User [ 26/Dec/19 ]

Author:

{'name': 'Lingzhi Deng', 'email': 'lingzhi.deng@mongodb.com', 'username': 'ldennis'}

Message: SERVER-45270 Revert 'SERVER-25284 Show IPs in rs.status()'

This reverts commit e1e95afbd58a7449dd1765cb910b4d136f95fcc4.
Branch: master
https://github.com/mongodb/mongo/commit/e53a88a3fa210ea3964586ecdf9ffecff39af2d7

Comment by Githook User [ 19/Apr/19 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: SERVER-25284 Show IPs in rs.status()

Add "ip" field for each member in replSetGetStatus response. Attempt to
resolve each member's hostname and set "ip" to a string (the IP literal)
or to null if resolution fails.
Branch: master
https://github.com/mongodb/mongo/commit/e1e95afbd58a7449dd1765cb910b4d136f95fcc4

Comment by A. Jesse Jiryu Davis [ 17/Apr/19 ]

We'll add resolved IPs to rs.status() as a new field, "ip", beside "name" and other member status fields. The "ip" field will be a IPv4 or IPv6 address as a string, depending on whether mongod would try to reach the member via IPv4 or IPv6. The field is null if hostname resolution failed.

We won't change rs.conf(), and we won't change the socket layer log messages since passing the original hostname down through layers of network code is too large a change for this ticket.

Comment by Gregory McKeon (Inactive) [ 25/Jan/19 ]

Sending to service arch, particularly with the split-horizon work we're doing now.

cc adam.martin@mongodb.com

Comment by Kevin Pulo [ 26/Jul/16 ]

rs.conf() is purely definitional, so I'm not sure that it makes sense to start augmenting it with variable information. But this is a good idea for adding to rs.status(). It is often very difficult to reconcile names and IP addresses when looking at replication events in logfiles.

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