-
Type: Bug
-
Resolution: Won't Do
-
Priority: Major - P3
-
Affects Version/s: None
The uptime field definition as per the docs is :
The uptime field holds a value that reflects the number of seconds that this member has been online.
This value does not appear for the member that returns the rs.status() data.
This needs to be refined.
This field represents the peer connection uptime value from the perspective of the node from which you run rs.status() command. The uptime field holds a value that reflects the number of seconds that this member has been online from the perspective of the member that returns the rs.status() data.
shard02:SECONDARY> rs.status() { "set" : "shard02", "date" : ISODate("2016-11-10T08:58:24.564Z"), "myState" : 2, "members" : [ { "_id" : 0, "name" : "Nishants-MacBook-Pro.local:27022", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 428, "optime" : Timestamp(1478679667, 1), "optimeDate" : ISODate("2016-11-09T08:21:07Z"), "lastHeartbeat" : ISODate("2016-11-10T08:58:23.121Z"), "lastHeartbeatRecv" : ISODate("2016-11-10T08:58:22.687Z"), "pingMs" : 0, "electionTime" : Timestamp(1478757759, 1), "electionDate" : ISODate("2016-11-10T06:02:39Z"), "configVersion" : 1 }, { "_id" : 1, "name" : "Nishants-MacBook-Pro.local:27023", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 428, "optime" : Timestamp(1478679667, 1), "optimeDate" : ISODate("2016-11-09T08:21:07Z"), "configVersion" : 1, "self" : true }, { "_id" : 2, "name" : "Nishants-MacBook-Pro.local:27024", "health" : 1, "state" : 7, "stateStr" : "ARBITER", "uptime" : 428, "lastHeartbeat" : ISODate("2016-11-10T08:58:23.121Z"), "lastHeartbeatRecv" : ISODate("2016-11-10T08:58:22.687Z"), "pingMs" : 0, "configVersion" : 1 } ], "ok" : 1 } shard02:SECONDARY> use admin switched to db admin shard02:SECONDARY> db.shutdownServer() server should be down... > exit bye shard02:SECONDARY> rs.status() { "set" : "shard02", "date" : ISODate("2016-11-10T08:59:08.586Z"), "myState" : 2, "members" : [ { "_id" : 0, "name" : "Nishants-MacBook-Pro.local:27022", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 4, "optime" : Timestamp(1478679667, 1), "optimeDate" : ISODate("2016-11-09T08:21:07Z"), "lastHeartbeat" : ISODate("2016-11-10T08:59:07.872Z"), "lastHeartbeatRecv" : ISODate("2016-11-10T08:59:06.932Z"), "pingMs" : 0, "electionTime" : Timestamp(1478757759, 1), "electionDate" : ISODate("2016-11-10T06:02:39Z"), "configVersion" : 1 }, { "_id" : 1, "name" : "Nishants-MacBook-Pro.local:27023", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 5, "optime" : Timestamp(1478679667, 1), "optimeDate" : ISODate("2016-11-09T08:21:07Z"), "configVersion" : 1, "self" : true }, { "_id" : 2, "name" : "Nishants-MacBook-Pro.local:27024", "health" : 1, "state" : 7, "stateStr" : "ARBITER", "uptime" : 4, "lastHeartbeat" : ISODate("2016-11-10T08:59:07.872Z"), "lastHeartbeatRecv" : ISODate("2016-11-10T08:59:06.932Z"), "pingMs" : 0, "configVersion" : 1 } ], "ok" : 1 } shard02:SECONDARY>
Situation is different on Primary.
shard02:PRIMARY> rs.status() { "set" : "shard02", "date" : ISODate("2016-11-10T09:03:20.443Z"), "myState" : 1, "members" : [ { "_id" : 0, "name" : "Nishants-MacBook-Pro.local:27022", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 10843, "optime" : Timestamp(1478679667, 1), "optimeDate" : ISODate("2016-11-09T08:21:07Z"), "electionTime" : Timestamp(1478757759, 1), "electionDate" : ISODate("2016-11-10T06:02:39Z"), "configVersion" : 1, "self" : true }, { "_id" : 1, "name" : "Nishants-MacBook-Pro.local:27023", "health" : 1, "state" : 2, "stateStr" : "SECONDARY", "uptime" : 255, "optime" : Timestamp(1478679667, 1), "optimeDate" : ISODate("2016-11-09T08:21:07Z"), "lastHeartbeat" : ISODate("2016-11-10T09:03:19.396Z"), "lastHeartbeatRecv" : ISODate("2016-11-10T09:03:20.328Z"), "pingMs" : 0, "configVersion" : 1 }, { "_id" : 2, "name" : "Nishants-MacBook-Pro.local:27024", "health" : 1, "state" : 7, "stateStr" : "ARBITER", "uptime" : 10841, "lastHeartbeat" : ISODate("2016-11-10T09:03:19.102Z"), "lastHeartbeatRecv" : ISODate("2016-11-10T09:03:19.102Z"), "pingMs" : 0, "configVersion" : 1 } ], "ok" : 1 } shard02:PRIMARY>