[SERVER-36665] Free Monitoring registration and metrics pings are incomplete for uninitialized repl set members Created: 14/Aug/18  Updated: 06/Dec/22

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

Type: Bug Priority: Major - P3
Reporter: Duncan Armstrong Assignee: Backlog - Security Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Security
Operating System: ALL
Steps To Reproduce:

1. Start an instance: mongod --replSet=stuff [...]
2. Shell into the instance: mongo
3. Enable Free Monitoring: db.enableFreeMonitoring()

Participants:

 Description   

When a mongod is started with --replSet=blah but rs.initialize() hasn't been called yet, both the register request and the metrics request have missing/broken values, though in different ways:

On register request, the IsMaster struct is missing all host/hostname values, eg.:

"IsMaster":
{
"LocalTime":"2018-08-02T20:52:50.864-04:00",
"IsMaster":false,
"Msg":"",
"SetName":"", // <-- missing
"Hosts":null, // <-- missing
"IsSecondary":false,
"PrimaryHostPort":"", // <-- missing
"HostPort":"", // <-- missing
"ArbiterOnly":false
}

(The missing values are pretty reasonable for an uninitialized repl set member - except I'd expect HostPort to have something.)

On metrics pings, a number of the discovery structs are nil altogether, eg.:

IsMaster:0xc420408020 
BuildInfo:<nil> 
HostInfo:<nil> 
StorageEngine:<nil> ReplSetGetConfig:<nil> RsStatus:0xc420408378 OplogUUID: 
ClusterManager:{Id:[] NextVersion:0 LastVersion:0} ServerStatus:0xc4204080c0

This "weird" state persists until rs.initialize() is called (you can even restart it and still see these weird payloads), at which point everything seems to snap into place and all is well.

Note: we've worked around both of these issues in CLOUDP-31606 and CLOUDP-31813, so this isn't a massively high priority from our perspective, but it might indicate issues worth addressing from your perspective?



 Comments   
Comment by Mark Benvenuto [ 21/Aug/18 ]

I have added this work to PM-1235. When the project gets scheduled, we will look into the work.

Comment by Duncan Armstrong [ 14/Aug/18 ]

CC mark.benvenuto

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