Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
There are numerous cases here:
http://docs.mongodb.org/manual/administration/replica-sets/
Where the _id of a member and its index in the rs.conf().members array are conflated (they are not equivalent). As an example, here is a live configuration on one of our replica sets:
rset:PRIMARY> c = rs.conf()
|
{
|
"_id" : "rset",
|
"version" : 23,
|
"members" : [
|
{
|
"_id" : 109,
|
"host" : "scrubbed"
|
},
|
...
|
]
|
}
|
I cannot index that replica by its _id, 109:
rset:PRIMARY> c.members[109].priority = 2
|
Mon Nov 26 03:58:36 TypeError: c.members[109] has no properties (shell):1
|
That is instead me asking for the 110th member of the members array.
I only saw those errors on the given page, so I'm not sure if it's a systemic misunderstanding and repeated elsewhere; the root assumption seems to be that index in the members array will always match _id, which isn't the case in any of our sets for various reasons.