[SERVER-26787] move logging for removing a ReplicaSetMonitor to ReplicaSetMonitorManager::removeMonitor() Created: 26/Oct/16  Updated: 31/Oct/16  Resolved: 26/Oct/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.4.0-rc1
Fix Version/s: 3.4.0-rc2

Type: Improvement Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2016-10-31
Participants:

 Description   

I noticed the log line is sometimes printed with the setName for the set being removed as blank:

https://logkeeper.mongodb.org/build/fe4fa63ca9b92ae1c06cce3da7f0f901/test/57feb247be07c4185402a0b9#L698

s20013| 2016-10-12T21:59:55.512+0000 I SHARDING [conn1] ShardRegistry::reload: Removing RSM for

This is because the line is printed in ShardRegistry::reload() when a shard that existed previously in the ShardRegistry cache no longer appears in the reload, regardless of whether the shard is a standalone or replica set:

https://github.com/mongodb/mongo/blob/r3.4.0-rc1/src/mongo/s/client/shard_registry.cpp#L305

It's somewhat misleading since, in the standalone case, no ReplicaSetMonitor actually gets removed.

I'd rather this is logged inside of ReplicaSetMonitorManager::removeMonitor, when a ReplicaSetMonitor is actually removed, since it has the added benefit that it will be printed by all code paths that remove a ReplicaSetMonitor (e.g., addShard, removeShard):

https://github.com/mongodb/mongo/blob/r3.4.0-rc1/src/mongo/client/replica_set_monitor_manager.cpp#L126-L128



 Comments   
Comment by Githook User [ 26/Oct/16 ]

Author:

{u'username': u'EshaMaharishi', u'name': u'Esha Maharishi', u'email': u'esha.maharishi@mongodb.com'}

Message: SERVER-26787 move logging for removing a ReplicaSetMonitor to ReplicaSetMonitorManager::removeMonitor()
Branch: master
https://github.com/mongodb/mongo/commit/f3f67b02ce9f9b4cdd68dd5d1e735b7161968841

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