[SERVER-6632] Unable to change priority on replset member Created: 28/Jul/12  Updated: 15/Aug/12  Resolved: 28/Jul/12

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

Type: Bug Priority: Major - P3
Reporter: Mike DiCarlo Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu
primary is running 2.0.4 (id 1)
secondary is running 2.0.6 (id 6)


Operating System: ALL
Participants:

 Description   

PRIMARY> cfg1 = rs.conf();
{
"_id" : "s0",
"version" : 13,
"members" : [

{ "_id" : 1, "host" : "ec2-184-72-40-101.us-west-1.compute.amazonaws.com:27017" }

,

{ "_id" : 4, "host" : "ec2-50-18-172-228.us-west-1.compute.amazonaws.com:27017" }

,

{ "_id" : 5, "host" : "ec2-184-169-145-5.us-west-1.compute.amazonaws.com:27017" }

,

{ "_id" : 3, "host" : "ec2-184-169-155-143.us-west-1.compute.amazonaws.com:27017", "priority" : 0, "hidden" : true, "buildIndexes" : false }

,

{ "_id" : 6, "host" : "50.23.75.130:28000" }

]
}
PRIMARY> cfg1.members[6].priority = 2;
Sat Jul 28 00:53:27 TypeError: cfg1.members[6] has no properties (shell):1



 Comments   
Comment by Mike DiCarlo [ 28/Jul/12 ]

Got it. Thanks!

Comment by Scott Hernandez (Inactive) [ 28/Jul/12 ]

That is an index accessor in javascript and not based on the _id value.

I think you want to use this line:

cfg1.members[4].priority = 2 

The index is 0-based so you have 5 hosts starting at 0 which results in the last one being at ordinal 4.

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