[SERVER-14702] ReplSetGetStatus show syncingTo for self in members array Created: 27/Jul/14  Updated: 27/Oct/15  Resolved: 17/Oct/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.7.4
Fix Version/s: 2.7.8

Type: Improvement Priority: Minor - P4
Reporter: Kevin Pulo Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-12811 hidden nodes don't always display syn... Closed
Related
is related to DOCS-4311 Update replSetGetStatus example to re... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The code for self:true in the members array of ReplSetGetStatus shows fewer fields than for remote hosts. Most of these are related to network (like pingMs) or remoteness (like the heartbeat fields), and so don't make sense to show for self. However, when running ReplSetGetStatus on a secondary, it still makes sense to see the syncingTo field, since the secondary is still syncing to some other member, and so it is confusing for the field to be absent. It is easy to miss the top-level syncingTo field when focussing on the status of the members.



 Comments   
Comment by Githook User [ 17/Oct/14 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-14702: add syncingTo to self output of replSetGetStatus
Branch: master
https://github.com/mongodb/mongo/commit/39c48e85f8563119caa769f34e2b6f22c4790430

Comment by Eric Milkie [ 12/Sep/14 ]

scotthernandez can you check if this behavior is now present in master?

Comment by Kevin Pulo [ 29/Jul/14 ]

Thanks Scott. Yes, as you suspected, this is about having the information present in the members array, alongside the other hosts which have it. It is easy to miss it at the top level, because the focus is usually on the status of the members.

Something like this:

{
    "set" : "testReplSet",
    "date" : ISODate("2014-07-27T13:42:46Z"),
    "myState" : 2,
    "syncingTo" : "localhost:31000",
    "members" : [
        {
            "_id" : 0,
            "name" : "localhost:31000",
            "health" : 1,
            "state" : 1,
            "stateStr" : "PRIMARY",
            "uptime" : 139,
            "optime" : Timestamp(1406468422, 1),
            "optimeDate" : ISODate("2014-07-27T13:40:22Z"),
            "lastHeartbeat" : ISODate("2014-07-27T13:42:45Z"),
            "lastHeartbeatRecv" : ISODate("2014-07-27T13:42:45Z"),
            "pingMs" : 0,
            "electionTime" : Timestamp(1406468433, 1),
            "electionDate" : ISODate("2014-07-27T13:40:33Z")
        },
        {
            "_id" : 1,
            "name" : "localhost:31001",
            "health" : 1,
            "state" : 2,
            "stateStr" : "SECONDARY",
            "uptime" : 139,
            "optime" : Timestamp(1406468422, 1),
            "optimeDate" : ISODate("2014-07-27T13:40:22Z"),
            "lastHeartbeat" : ISODate("2014-07-27T13:42:45Z"),
            "lastHeartbeatRecv" : ISODate("2014-07-27T13:42:45Z"),
            "pingMs" : 0,
            "syncingTo" : "localhost:31000"
        },
        {
            "_id" : 2,
            "name" : "localhost:31002",
            "health" : 1,
            "state" : 2,
            "stateStr" : "SECONDARY",
            "uptime" : 157,
            "optime" : Timestamp(1406468422, 1),
            "optimeDate" : ISODate("2014-07-27T13:40:22Z"),
            "syncingTo" : "localhost:31000",
            "self" : true
        }
    ],
    "ok" : 1
}

Comment by Scott Hernandez (Inactive) [ 27/Jul/14 ]

This information is currently provided at the top level, and is not duplicated under the specific member element:

{
	"set" : "testReplSet",
	"date" : ISODate("2014-07-27T13:42:46Z"),
	"myState" : 2,
	"syncingTo" : "localhost:31000",
	"members" : [
		{
			"_id" : 0,
			"name" : "localhost:31000",
			"health" : 1,
			"state" : 1,
			"stateStr" : "PRIMARY",
			"uptime" : 139,
			"optime" : Timestamp(1406468422, 1),
			"optimeDate" : ISODate("2014-07-27T13:40:22Z"),
			"lastHeartbeat" : ISODate("2014-07-27T13:42:45Z"),
			"lastHeartbeatRecv" : ISODate("2014-07-27T13:42:45Z"),
			"pingMs" : 0,
			"electionTime" : Timestamp(1406468433, 1),
			"electionDate" : ISODate("2014-07-27T13:40:33Z")
		},
		{
			"_id" : 1,
			"name" : "localhost:31001",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 139,
			"optime" : Timestamp(1406468422, 1),
			"optimeDate" : ISODate("2014-07-27T13:40:22Z"),
			"lastHeartbeat" : ISODate("2014-07-27T13:42:45Z"),
			"lastHeartbeatRecv" : ISODate("2014-07-27T13:42:45Z"),
			"pingMs" : 0,
			"syncingTo" : "localhost:31000"
		},
		{
			"_id" : 2,
			"name" : "localhost:31002",
			"health" : 1,
			"state" : 2,
			"stateStr" : "SECONDARY",
			"uptime" : 157,
			"optime" : Timestamp(1406468422, 1),
			"optimeDate" : ISODate("2014-07-27T13:40:22Z"),
			"self" : true
		}
	],
	"ok" : 1
}

If you want it duplicated within the member please make that clear when you change the description and reopen, or create a new issue.

FYI: If the node has no sync source, or if it is shunned/primary no field will be included in the output.

Also, in the future please provide an example of the output you expect so it is clear what is being requested, and in what way.

Generated at Thu Feb 08 03:35:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.