Setting replSet to P0 Failed w/ Errmsg

I have the following replSet config as below but when I attempted to reconfigure the replSet to set the secondary site nodes to priority 0, I received the following errors:

rs0:PRIMARY> rs.reconfig(cfg)
{
	"ok" : 0,
	"errmsg" : "This node, db1:27017, with _id 9 is not electable under the new configuration version 76695 for replica set rs0",
	"code" : 103

My rs.conf()

		    {
    			"_id" : 3,
    			"host" : "db3:27017",
    			"arbiterOnly" : false,
    			"buildIndexes" : true,
    			"hidden" : false,
    			"priority" : 1,
    			"tags" : {

    			},
    			"slaveDelay" : NumberLong(0),
    			"votes" : 1
    		},
    		{
    			"_id" : 4,
    			"host" : "db4:27017",
    			"arbiterOnly" : false,
    			"buildIndexes" : true,
    			"hidden" : false,
    			"priority" : 1,
    			"tags" : {

    			},
    			"slaveDelay" : NumberLong(0),
    			"votes" : 1
    		},
    		{
    			"_id" : 5,
    			"host" : "db-arb1:27017",
    			"arbiterOnly" : true,
    			"buildIndexes" : true,
    			"hidden" : false,
    			"priority" : 1,
    			"tags" : {

    			},
    			"slaveDelay" : NumberLong(0),
    			"votes" : 1
    		},
    		{
    			"_id" : 8,
    			"host" : "db2:27017",
    			"arbiterOnly" : false,
    			"buildIndexes" : true,
    			"hidden" : false,
    			"priority" : 2,
    			"tags" : {

    			},
    			"slaveDelay" : NumberLong(0),
    			"votes" : 1
    		},
    		{
    			"_id" : 9,
    			"host" : "db1:27017",
    			"arbiterOnly" : false,
    			"buildIndexes" : true,
    			"hidden" : false,
    			"priority" : 2,
    			"tags" : {

    			},
    			"slaveDelay" : NumberLong(0),
    			"votes" : 1
    		}

Hello Carlos Mennens, welcome to the MongoDB Community forum.

“This node, db1:27017, with _id 9 is not electable under the new configuration version 76695 for replica set rs0”

Note that:

  • A member with a priority of 0 is not eligible to become primary.
  • Changing the balance of priority in a replica set will trigger one or more elections. If a lower priority secondary is elected over a higher priority secondary, replica set members will continue to call elections until the highest priority available member becomes primary.

I think an election was triggered when you changed the configuration and the message is confirming that the node db1:27017, with _id 9 is not eligible for election under the new configuration.

I’m still very confused.

I have x5 nodes. I simply am trying to make x2 of the nodes in the config p0 which are currently p1 shown from my rs.conf() above.

The two nodes I am intending to make p0 are currently not primary.
The node I’m connected to attempting to reconfigure replication is _id 9 PRIMARY which is currently p2.
If I reconfigure two p1 secondary nodes to just be p0 secondary nodes and those are the only changes made to the rs.conf, why when I reconfigure rs.reconfig from _id 9 which is PRIMARY p2 and has not changed at all and has remained unchanged in the reconfigure tasks…does it produce an error about _id 9 when nothing has warranted this node to change. I don’t care if the other p2 node in the current config is elected as I’m only changing the priority on two secondary’s not currently elected and with a p1.

What am I not understanding? The error references a node I’ve not made any changes to nor do I expect it to need to change as the elected primary.

If _id 9 is no longer electable with the new config, why??? I only changed the priority on _id 3 & _id 4 ONLY!!! So if a reconfigure is issued with only those two changes, why is a current primary with a p1 no longer eligible to be primary under the new config which made no changes to _id 9 at all.

Very confused…

Hi @oldcomputer

Skimming the output of your rs.conf(), I found this:

    		{
    			"_id" : 5,
    			"host" : "db-arb1:27017",
    			"arbiterOnly" : true,
    			"buildIndexes" : true,
    			"hidden" : false,
    			"priority" : 1,
    			"tags" : {

    			},
    			"slaveDelay" : NumberLong(0),
    			"votes" : 1
    		},

So apparently you have an electable arbiter, which should not happen if your MongoDB is version 3.6 or newer. Since MongoDB 3.6 is the oldest supported version, I would encourage you to consider upgrading as well.

With regard to your issue in reconfig, could you please post more information:

  • The new configuration in the cfg variable?
  • Your MongoDB version (output of db.version())
  • Output of rs.status()

Best regards,
Kevin

2 Likes